Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-331

Filters and HTTP Header "Accept-Encoding: identity;q=1, *;q=0" (not supported)

XMLWordPrintable

    • Hide
      • Install wildfly 8
      • Add to standalone.xml a gzip filter and exclude the target url (because we dont need gzip in this response... it is a mp3 file for example)
      • Make a simple app to serve a file (or simply a message with content type "audio/mpeg" for example).
      • Open Chrome and Send an Http request to the application (on wildfly) setting a HTTP header "Accept-Encoding:identity;q=1, *;q=0" with a "postman" client (or a similar util).
        NOTE: Take care about chrome limitations... you need to use postman interceptor plugin activated (or similar util) to send this kind of headers really from Chrome to your server.
      • Check response HTTP: 406 ERROR.

      • Disable gzip and check that this encoding is accepted perfectly without filters.
      Show
      Install wildfly 8 Add to standalone.xml a gzip filter and exclude the target url (because we dont need gzip in this response... it is a mp3 file for example) Make a simple app to serve a file (or simply a message with content type "audio/mpeg" for example). Open Chrome and Send an Http request to the application (on wildfly) setting a HTTP header "Accept-Encoding:identity;q=1, *;q=0" with a "postman" client (or a similar util). NOTE: Take care about chrome limitations... you need to use postman interceptor plugin activated (or similar util) to send this kind of headers really from Chrome to your server. Check response HTTP: 406 ERROR. Disable gzip and check that this encoding is accepted perfectly without filters.

      I test my app in a wildfly 8.1.0.Final server with a web service that response an audio/mpeg (content-type) data.
      When I add a Gzip Filter to my standalone config... I have problems...
      With firefox and ie browsers, all is OK. But when Chrome try to get data from my web service it fails.

      Reason: Chrome from an audio HTML5 component sends a request to server with a Accept-Encoding header like this:

      { Accept:*/* Accept-Encoding:identity;q=1, *;q=0 }

      When wildfly process Gzip filter (also if it is excluded this type of resource by regexp) calls to the undertow code: ContentEncodingRepository.getContentEncodings

      I read this method in github and i think that could have a bug with this kind of "Accept-Encoding"... rejecting all with a 406 ERROR.

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              arielcarrera Ariel Carrera (Inactive)
              Stuart Douglas (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: