NullPointer
NullPointer

Reputation: 33

Chrome issue with 301 redirect and SSL

I am currently experiencing an issue that only occurs in Chrome. If I use https://example.com it won't load in chrome and it will complain with the following message:

This site can’t be reached

The webpage at https://example.com/ might be temporarily down or it may have moved permanently to a new web address. ERR_RESPONSE_HEADERS_TRUNCATED

It works fine in any other browser but Chrome.

If I only use http then it works fine.

I read somewhere that if I use 302 redirect the problem is solved. So I asked the team to test it and it actually solved the issue, however, we are avoiding using 302 and we need to stick with 301.

Upvotes: 2

Views: 3469

Answers (1)

Barry Pollard
Barry Pollard

Reputation: 45970

Don't think it's anything to do with 301 or 302. Think it's because you are setting them up differently- in that you are not closing the 301 request properly.

See here: https://productforums.google.com/forum/m/#!msg/chrome/2tttvx4VCDQ/kUIE1FXxve0J

This works:

"HTTP/1.1 301 Moved Permanently\r\n" + "Location: https://www.example.com" + http.req.url.path_and_query.http_url_safe + "\r\n\r\n"

This doesn't:

"HTTP/1.1 301 Moved Permanently\r\n" + "Location: https://www.example.com" + http.req.url.path_and_query.http_url_safe + "\r\n"

Upvotes: 1

Related Questions