Tadwork/experimental-browser

Exercise: Chapter 1 - Redirects:

Opened this issue · 0 comments

Redirects: Error codes in the 300 range request a redirect. When your browser encounters one, it should make a new request to the URL given in the Location header. Sometimes the Location header is a full URL, but sometimes it skips the host and scheme and just starts with a / (meaning the same host and scheme as the original request). The new URL might itself be a redirect, so make sure to handle that case. You don’t, however, want to get stuck in a redirect loop, so make sure limit how many redirects your browser can follow in a row. You can test this with with the URL http://browser.engineering/redirect, which redirects back to this page.

Source