nodeSolidServer / node-solid-server

Solid server on top of the file-system in NodeJS
https://solidproject.org/for-developers/pod-server
Other
1.78k stars 303 forks source link

Updates-Via header in OPTIONS #1222

Open jpnp opened 5 years ago

jpnp commented 5 years ago

The Solid WebSocket API Specs say that Updates-Via header can be found in an OPTIONS request to the server.

I am not finding an Updates-Via header in OPTIONS for node solid server, though I do get one if I do an HTTP HEAD:

$ curl -k -i  -X OPTIONS https://localhost:8443/public/
HTTP/1.1 204 No Content
X-Powered-By: solid-server/5.1.2
Vary: Accept, Authorization, Origin, Access-Control-Request-Headers
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: OPTIONS,HEAD,GET,PATCH,POST,PUT,DELETE
Access-Control-Max-Age: 1728000
Access-Control-Expose-Headers: Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate
Allow: COPY,GET,HEAD,POST,PATCH,PUT,DELETE
Link: <https://localhost:8443/public/.well-known/solid>; rel="service", <https://localhost:8443>; rel="http://openid.net/specs/connect/1.0/issuer", <.acl>; rel="acl", <.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Container>; rel="type", <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Accept-Patch: application/sparql-update
Accept-Post: */*
ETag: W/"23-dYHCBqdZ5e1V1nWlG0I6iB9SOvk"
Date: Wed, 05 Jun 2019 20:57:22 GMT
Connection: keep-alive

vs

$ curl -k --head https://localhost:8443/public/
HTTP/1.1 200 OK
X-Powered-By: solid-server/5.1.2
Vary: Accept, Authorization, Origin
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate
Allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE
Link: <.acl>; rel="acl", <.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Container>; rel="type", <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
MS-Author-Via: SPARQL
Updates-Via: wss://localhost:8443
Content-Type: application/octet-stream; charset=utf-8
Content-Length: 2
ETag: W/"2-nOO9QiTIwXgNtWtBJezz8kv3SLc"
Date: Wed, 05 Jun 2019 20:57:00 GMT
Connection: keep-alive

This is using v5.1.2

michielbdejong commented 5 years ago

@jpnp I guess you're right, it should be returned on OPTIONS. I ran into the same problem when writing https://solid-notify.5apps.com/ yesterday, and worked around it by just doing an authenticated GET, see https://github.com/michielbdejong/solid-notify/blob/master/index.html#L84-L85

jpnp commented 5 years ago

HEAD is a good enough work around for me, but the implementation and API spec probably should match.

CxRes commented 4 years ago

This still has not been fixed in the spec. I wasted an hour before finding this issue :(

jaxoncreed commented 4 years ago

This issue has been labeled as "test-case" by @kjetilk . So it will be making its way into the test suite and future spec.