a YUY
a YUY

Reputation: 87

Why does browser treat localhost and 127.0.0.1 differently?

In a simple oauth call the application is called from localhost and the return url comes in 127.0.0.1 but browser gives and error as Blocked a frame with origin "http://127.0.0.1" from accessing a frame with origin "http://localhost". Why does browser treat them differently?

Thanks

Upvotes: 0

Views: 452

Answers (1)

Matthew
Matthew

Reputation: 639

One is a name, the other is an ip address.

Its just a security feature, to stop cross domain requests etc.

127.0.0.1 != localhost, localhost resolves to 127.0.0.1 it is not the same "domain".

Upvotes: 1

Related Questions