Mink icon indicating copy to clipboard operation
Mink copied to clipboard

Timemaps specified in HTTP 3XX responses cannot be extracted before browser forwards

Open machawk1 opened this issue 11 years ago • 7 comments

Reported by @phonedude

http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms

machawk1 avatar Sep 19 '14 19:09 machawk1

This might be attributed to the redirect not following the same origin policy, e.g., http://mementoweb.org/proxy/mediawiki/timegate/http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms

forwards to http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=107221

machawk1 avatar Sep 19 '14 20:09 machawk1

curl -I "http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms"

HTTP/1.1 200 OK
...
Link: <http://ws-dl-05.cs.odu.edu/demo-headers/api.php>; rel="http://mementoweb.org/terms/api/mediawiki/", <http://mementoweb.org/proxy/mediawiki/timegate/http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms>; rel="timegate"
...

Timegate: http://mementoweb.org/proxy/mediawiki/timegate/http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms

curl -I "http://mementoweb.org/proxy/mediawiki/timegate/http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms"

HTTP/1.1 302 Found
...
Vary: negotiate,accept-datetime
Link: <http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms>;rel="original",<http://mementoweb.org/proxy/mediawiki/timemap/link/http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms>;rel="timemap";type="application/link-format",<http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=2761>;datetime="Fri, 27 Apr 2007 19:07:50 GMT";rel="first memento",<http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=107221>;datetime="Fri, 06 Sep 2013 17:16:01 GMT";rel="last memento"
Location: http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=107221
...

curl -I "http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=107221"

HTTP/1.1 200 OK
...
Memento-Datetime: Fri, 06 Sep 2013 17:16:01 GMT
Link: <http://ws-dl-05.cs.odu.edu/demo-headers/api.php>; rel="http://mementoweb.org/terms/api/mediawiki/", <http://mementoweb.org/proxy/mediawiki/timegate/http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms>; rel="timegate", <http://ws-dl-05.cs.odu.edu/demo-headers/index.php/Seven_Kingdoms>; rel="original", <http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=2761>; rel="first memento"; datetime="Fri, 27 Apr 2007 19:07:50 GMT", <http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=107221>; rel="last memento"; datetime="Fri, 06 Sep 2013 17:16:01 GMT", <http://ws-dl-05.cs.odu.edu/demo-headers/index.php?title=Seven_Kingdoms&oldid=105912>; rel="prev"
...
Vary: Accept-Encoding,Cookie
...

machawk1 avatar Sep 22 '14 20:09 machawk1

After step 2/3 in last comment, timemap should be used if present. It looks like timegate is getting precedence, even if a timemap is available.

The issue is, however, that the response after command 2 is not considered in the browser, as the location header is followed automatically in the browser context (vs. curl). Can Ajax intercept this, consider the timemap, and not forward the request?

machawk1 avatar Sep 22 '14 20:09 machawk1

Baffling at the implementation level, as there does not seem to be a way to grab this information before the browser forwards the request.

http://stackoverflow.com/questions/25982672/extracting-http-headers-from-http-300-code-responses-using-ajax

machawk1 avatar Sep 22 '14 20:09 machawk1

Using the deprecated success() and complete() Ajax handlers still seems to only supply the HTTP data and headers for the ultimate forwarded destination and not the intermediary one with the 302.

machawk1 avatar Sep 22 '14 22:09 machawk1

@N0taN3rd

machawk1 avatar Jan 28 '16 21:01 machawk1

As of 59631c382ae4f7f12fc674e1aeb98434b8cd78f6 , 1000 mementos is listed, which is only the first page from the indexed TimeMap.

machawk1 avatar Feb 01 '16 02:02 machawk1