Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1742

SSE - filters are not picked up, works for normal endpoints

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0.0.Beta1
    • Component/s: jaxrs
    • Labels:
      None

      Description

      When using SSE filters are not picked up, works for normal endpoints.

      I am using WF 10.1 + RESTEasy master 442e6fa8a - (HEAD -> master, upstream/master, origin/master, origin/HEAD) RESTEASY-1738 (4 days ago) <Ron Sigal>
      Testing project is https://github.com/rsvoboda/rsvoboda-playground/tree/master/ee8-sample-sse.

      When I invoke curl -vvv http://localhost:8080/ee8-sample-sse/resources/foo I can see headers from https://github.com/rsvoboda/rsvoboda-playground/blob/master/ee8-sample-sse/src/main/java/org/experiments/rsvoboda/sse/CORSFilter.java

      When I invoke curl -vvv -i http://localhost:8080/ee8-sample-sse/resources/beats there are no additional headers, filter is not invoked.

      This prevents any use of SSE outside current deployment / server. Setting Priority to Critical.

      I noticed this via .js app when browser was complaining about origin policy, curl is used in this JIRA as it is easier to use.

      Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote
        resource at http://127.0.0.1:8080/ee8-sample-sse/resources/beats.
        (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
      

       rsvoboda  rs  ~  git  rsvoboda-playground  ee8-sample-sse  webapp  master  $  curl -vvv http://localhost:8080/ee8-sample-sse/resources/foo
      *   Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8080 (#0)
      > GET /ee8-sample-sse/resources/foo HTTP/1.1
      > Host: localhost:8080
      > User-Agent: curl/7.53.1
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      < X-Powered-By: Undertow/1
      < Access-Control-Allow-Headers: origin, content-type, accept, authorization, ETag, if-none-match
      < Server: WildFly/10
      < Access-Control-Expose-Headers: origin, content-type, accept, authorization, ETag, if-none-match
      < Date: Mon, 23 Oct 2017 12:49:25 GMT
      < Connection: keep-alive
      < Access-Control-Allow-Origin: *
      < x-foo-by: rs
      < Access-Control-Allow-Credentials: true
      < Content-Type: application/json
      < Content-Length: 33
      < Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
      < Access-Control-Max-Age: 1209600
      < 
      * Connection #0 to host localhost left intact
      {"key1":"value1","key2":"value2"} 
      

      curl -vvv -i http://localhost:8080/ee8-sample-sse/resources/beats
      *   Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8080 (#0)
      > GET /ee8-sample-sse/resources/beats HTTP/1.1
      > Host: localhost:8080
      > User-Agent: curl/7.53.1
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      HTTP/1.1 200 OK
      < Connection: keep-alive
      Connection: keep-alive
      < X-Powered-By: Undertow/1
      X-Powered-By: Undertow/1
      < Server: WildFly/10
      Server: WildFly/10
      < Transfer-Encoding: chunked
      Transfer-Encoding: chunked
      < Content-Type: text/event-stream
      Content-Type: text/event-stream
      < Date: Mon, 23 Oct 2017 12:49:27 GMT
      Date: Mon, 23 Oct 2017 12:49:27 GMT
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jim.ma Jim Ma
                  Reporter:
                  rsvoboda Rostislav Svoboda
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: