According to AJAX redirect dilemma, how to get redirect URL OR how to set properties for redirect request it doesn't seem to be possible to find out when an HTTP redirect occurs nor the target URL the browser gets redirected to.
As such, how can one compare two URLs in a reliable manner? For example, my code compares two URLs:
http://example.com/users/joe@home.com/
and
http://example.com/users/53/
The two actually refer to the same user (the first request redirects to the second using HTTP 303
) but there doesn't seem to be a way for the browser to discover this so it mistakenly believes the two users differ.
Technically speaking, the resource representation could contain its canonical URI, but I'd like to avoid such workarounds/hacks if possible. Any ideas?