You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (r.transport() != TRANSPORT.SSE)
returnResponse.status(Status.BAD_REQUEST).entity("SSE is the only thing supported").build();
elsereturnResponse.status(451).entity("{my-error-body}").build();
Atmosphere Info
version 2.7.7
Expected behavior
long-polling (actual, correct):
$ curl -s -i -X GET 'http://localhost:8080/chat/the/sse/error' -H 'Accept: text/event-stream,application/json'
HTTP/1.1 400 Bad Request
(snip)
Content-Length: 31
SSE is the only thing supported%
$
Interestingly, the length (and number of spaces) is the correct size. Note I used the terminal garbage % to show the end of line as there was no newline.
Systems (please complete the following information):
OS: linux x64
Browser name and version: N/A
Java version and distribution: OpenJDK 1.8 && 11
Server name and version: Jetty
Additional context
A "normal" sse call has lots of spaces, I'm not sure if it's relevant but I noticed it:
$ curl -s -i -X GET 'http://localhost:8080/chat/the/sse/normal?X-Atmosphere-Transport=sse' -H 'Accept: text/event-stream,application/json'
HTTP/1.1 200 OK
(snip)
Transfer-Encoding: chunked
data:suspend
data:X
^C
$
The text was updated successfully, but these errors were encountered:
Describe the bug
SSE transport doesn't allow error bodies to be written, unlike other transports:
(Full source based on samples used in the curl requests is at https://gist.github.com/byteit101/63c5fe645cbfa7e2222948bd77e72d51 )
Atmosphere Info
Expected behavior
long-polling (actual, correct):
SSE (theoretical response):
$ curl -s -i -X GET 'http://localhost:8080/chat/the/sse/error?X-Atmosphere-Transport=sse' -H 'Accept: text/event-stream,application/json' HTTP/1.1 451 (snip) Content-Length: 15 {my-error-body}% $
Actual behavior
SSE:
$ curl -s -i -X GET 'http://localhost:8080/chat/the/sse/error?X-Atmosphere-Transport=sse' -H 'Accept: text/event-stream,application/json' HTTP/1.1 451 (snip) Content-Length: 15 % $
Interestingly, the length (and number of spaces) is the correct size. Note I used the terminal garbage
%
to show the end of line as there was no newline.Systems (please complete the following information):
Additional context
A "normal" sse call has lots of spaces, I'm not sure if it's relevant but I noticed it:
The text was updated successfully, but these errors were encountered: