In a dev environment I have the problem that my browser (Yandex) redirects (307) an OPTIONS
request to the https version of the URL. As we don't have SSL set up the request then fails with the error Response for preflight is invalid (redirect)
.
相关问题
- firebase storage cors strange Behaviour
- Dependency injection into Logback Appenders with S
- Deserialize duplicate keys to list using Jackson
- How can I access the repository from the entity in
- cypress xhr request retry ontimeout
相关文章
- How to load @Configuration classes from separate J
- Using Spring Dynamic Languages Support from Groovy
- Spring JMS : Set ErrorHandler for @JmsListener ann
- ModelMapper: Choose mapping based on Child class
- Configure Spring for CORS
- Remove transitive classpath dependency in gradle
- SpringBoot When file upload size limit exceeds get
- Send a GET request with a body in JavaScript (XMLH
I resolved this issue by configuring the the HSTS header as follows:
Disabling HSTS did not work for me.
If you don’t have HTTPS set up then the HSTS value should never be read - browsers must ignore HSTS sent over an unencrypted HTTP connection.
If you once did have HTTPS but now no longer do (or if you have HTTPS on some of your domains/pages), then your browser may have cached the HSTS setting for whatever max-age value was set when the browser last read the header. You would need to clear this in your browser. How to do this varies from browser to browser, but one of the easier ways that works in all browsers is to publish a new HSTS header with a max-age of 0 like you have done and then visit a page over HTTPS (not over unencrypted HTTP). This obviously requires you to have a HTTPS setup which you say you do not have? After all your browsers all have got the new setting for all affected domains, you can then stop publishing that HSTS header completely.
Skipping the reset step and just turning off the header when the browser has a previous version cached will not work - at least until the browser’s cached version expires after the max-age time.