oduwsdl / MemGator

A Memento Aggregator CLI and Server in Go
https://memgator.cs.odu.edu/api.html
MIT License
55 stars 11 forks source link

Provide Memento Link headers in response #61

Closed machawk1 closed 8 years ago

machawk1 commented 8 years ago

As verbally suggested by @phonedude , the LANL aggregator TimeGate endpoint supplies Memento HTTP Link headers. MemGator ought to as well. The TimeMap endpoint from LANL does not supply these headers.

$ curl -I http://timetravel.mementoweb.org/timegate/http://matkelly.com
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.8.0
Date: Fri, 18 Mar 2016 19:35:53 GMT
Content-Type: text/plain; charset=iso-8859-1
Content-Length: 0
Connection: keep-alive
Location: http://web.archive.org/web/20160313135837/http://matkelly.com
Vary: Accept-Datetime
Link: <http://matkelly.com>;rel="original" ,<http://timetravel.mementoweb.org/timemap/link/http://matkelly.com>;rel="timemap"; type="application/link-format",<http://web.archive.org/web/20160313135837/http://matkelly.com>;rel="memento last"; datetime="Sun, 13 Mar 2016 13:58:37 GMT",<http://web.archive.org/web/20060514123511/http://matkelly.com>;rel="memento first"; datetime="Sun, 14 May 2006 12:35:11 GMT"
Last-Modified: Fri, 18 Mar 2016 19:35:53 GMT

$ curl -I http://timetravel.mementoweb.org/timemap/json/http://matkelly.com
HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Fri, 18 Mar 2016 19:30:42 GMT
Content-Type: application/json
Content-Length: 0
Connection: keep-alive
Access-Control-Allow-Origin: *

$ curl -I http://memgator.cs.odu.edu:1208/timemap/json/http://matkelly.com
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Link, Location, X-Memento-Count, X-Generator
Content-Type: application/json
X-Generator: MemGator:1.0-rc4
X-Memento-Count: 78
Date: Fri, 18 Mar 2016 19:31:32 GMT
ibnesayeed commented 8 years ago

If I understood your point correctly then actually MemGator does this already. I think that's an essential feature and part of the TimeGate protocol specs.

$ curl -I http://memgator.cs.odu.edu:1208/timegate/http://matkelly.com
HTTP/1.1 302 Found
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Link, Location, X-Memento-Count, X-Generator
Link: <http://matkelly.com>; rel="original", <http://web.archive.org/web/20060514123511/http://matkelly.com>; rel="first memento"; datetime="Sun, 14 May 2006 12:35:11 GMT", <http://web.archive.org/web/20160112094927/http://matkelly.com>; rel="prev memento"; datetime="Tue, 12 Jan 2016 09:49:27 GMT", <http://web.archive.org/web/20160313135837/http://matkelly.com>; rel="last memento"; datetime="Sun, 13 Mar 2016 13:58:37 GMT", <http://memgator.cs.odu.edu:1208/timemap/link/http://matkelly.com>; anchor="http://matkelly.com"; rel="timemap"; type="application/link-format", <http://memgator.cs.odu.edu:1208/timemap/json/http://matkelly.com>; anchor="http://matkelly.com"; rel="timemap"; type="application/json", <http://memgator.cs.odu.edu:1208/timemap/cdxj/http://matkelly.com>; anchor="http://matkelly.com"; rel="timemap"; type="application/cdxj+ors", <http://memgator.cs.odu.edu:1208/timegate/http://matkelly.com>; anchor="http://matkelly.com"; rel="timegate"
Location: http://web.archive.org/web/20160313135837/http://matkelly.com
Vary: accept-datetime
X-Generator: MemGator:1.0-rc4
Date: Fri, 18 Mar 2016 20:37:03 GMT
Content-Type: text/plain; charset=utf-8

Are you talking about anything otherwise?

phonedude commented 8 years ago

yeah, that's my fault. I looked at the TimeMap and thought the headers needed to be there too but I was mistaken. The TimeMap is already self-documenting, just URI-M and URI-G need the headers. Sorry for the confusion.

ibnesayeed commented 8 years ago

Considering it invalid hence closing this issue.