New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 404s on IE 11 using compatibility view #2782

Merged
merged 1 commit into from Sep 7, 2016

Conversation

Projects
None yet
2 participants
@edmundoa
Member

edmundoa commented Sep 6, 2016

When Graylog is running on an intranet, IE 11 may be requesting the site in compatibility view, depending on the organization and user settings. That applies even when properly setting the X-UA-Compatible header and meta tags.

Making requests in compatibility view, IE does not include either text/html or application/xhtml+xml MIME types in the Accept header, which are the values we checked in order to deliver the web interface HTML document when requesting a resource that doesn't exist (i.e. when clicking on a page number on the search page).

Unfortunately, the way legacy IEs work is also odd in the way it includes Accept headers on requests, being */* the only one that is always included. You can read more about it here:
https://blogs.msdn.microsoft.com/ieinternals/2009/07/01/ie-and-the-accept-header/

To solve this issue, these changes relax the media types comparison on WebAppNotFoundResponseFilter, by also serving the web interface HTML document if any of the request headers is compatible with text/html or application/xhtml+xml. In that way we also consider that requests with a wildcard MIME type will be able to handle the HTML document, but we still avoid serving HTML if the request specified another accepted MIME type.

Fixes #2768

Fix 404s on IE 11 using compatibility view
When Graylog is running on an intranet, IE 11 may be requesting the site
in compatibility view, depending on the organization and user settings.
That applies even when properly setting the X-UA-Compatible header and
meta tags.

Making requests in compatibility view, IE does not include either
`text/html` or `application/xhtml+xml` MIME types in the `Accept`
header, which are the values we checked in order to deliver the web
interface HTML document when requesting a resource that doesn't exist
(i.e. when clicking on a page number on the search page).

Unfortunately, the way legacy IEs work is also odd in the way it
includes `Accept` headers on requests, being `*/*` the only one that is always
included. You can read more about it here:
https://blogs.msdn.microsoft.com/ieinternals/2009/07/01/ie-and-the-accept-header/

To solve this issue, these changes relax the media types comparison on
`WebAppNotFoundResponseFilter`, by also serving the web interface HTML
document if any of the request headers is compatible with `text/html` or
`application/xhtml+xml`. In that way we also consider that requests with
a wildcard MIME type will be able to handle the HTML document, but we
still avoid serving HTML if the request specified another accepted MIME
type.

Fixes #2768

@edmundoa edmundoa added this to the 2.1.1 milestone Sep 6, 2016

@edmundoa

This comment has been minimized.

Member

edmundoa commented Sep 6, 2016

The changes also need to be applied into master.

@dennisoelkers dennisoelkers merged commit 20d4b11 into 2.1 Sep 7, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 1343 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 826 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@dennisoelkers dennisoelkers deleted the issue-2768 branch Sep 7, 2016

dennisoelkers added a commit that referenced this pull request Sep 7, 2016

Fix 404s on IE 11 using compatibility view (#2782)
When Graylog is running on an intranet, IE 11 may be requesting the site
in compatibility view, depending on the organization and user settings.
That applies even when properly setting the X-UA-Compatible header and
meta tags.

Making requests in compatibility view, IE does not include either
`text/html` or `application/xhtml+xml` MIME types in the `Accept`
header, which are the values we checked in order to deliver the web
interface HTML document when requesting a resource that doesn't exist
(i.e. when clicking on a page number on the search page).

Unfortunately, the way legacy IEs work is also odd in the way it
includes `Accept` headers on requests, being `*/*` the only one that is always
included. You can read more about it here:
https://blogs.msdn.microsoft.com/ieinternals/2009/07/01/ie-and-the-accept-header/

To solve this issue, these changes relax the media types comparison on
`WebAppNotFoundResponseFilter`, by also serving the web interface HTML
document if any of the request headers is compatible with `text/html` or
`application/xhtml+xml`. In that way we also consider that requests with
a wildcard MIME type will be able to handle the HTML document, but we
still avoid serving HTML if the request specified another accepted MIME
type.

Fixes #2768
(cherry picked from commit 20d4b11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment