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
In IE11, Tools -> Compatibility View Settings -> Add localhost in the list
Visit http://localhost:8080/foo
It displays IE 404 instead of Spring Boot Whitelabel page.
This is due to the Accept header for Compatibility mode contains: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Hence the BasicErrorController returns the ResponseEntity instead of the "error" view.
Mimetypes application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword are all application/file related and not suitable for HTML output.
Writing HTML in response of */* would work, but this would also mean that content negotiation is broken for JSON, XML, etc.
For that very specific use case, I'd try to write a Servlet Filter that adds a text/html mimetype to HTTP requests coming from that particular client. It will be a problem for all endpoints anyway.
You can configure the content negotiation to your liking (how it's operated, default content type, etc), but it's likely to break things for all other clients.
If you'd like to do that for this particular client, then the Servlet filter is in my opinion still the best choice.
In IE11, Tools -> Compatibility View Settings -> Add localhost in the list
Visit http://localhost:8080/foo
It displays IE 404 instead of Spring Boot Whitelabel page.
This is due to the Accept header for Compatibility mode contains:
application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Hence the BasicErrorController returns the ResponseEntity instead of the "error" view.
Per https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation
Not sure how best we can fix this, probably declare one more content type in the "produces" value in BasicErrorController#errorHtml?
The text was updated successfully, but these errors were encountered: