til: localhost & 127.0.0.1 are not same origin 🤯

The IP address for localhost is traditionally 127.0.0.1, so you’d expect http://localhost:9999 and http://127.0.0.1:9999 to be the same origin.

BUT.

The origin comparison only compares the string values of the scheme, host, and port, and knows nothing about what host an IP address maps to. In my example, “localhost” and “127.0.0.1” are different strings, and therefore the request isn’t a same-origin request.

Popular posts from this blog

What really is a Hypertext?

Browser Rendering Phase

Crypto crypto everywhere but not a token to bet your life on