kubo icon indicating copy to clipboard operation
kubo copied to clipboard

Support the HTTP OPTIONS method on the gateway

Open markg85 opened this issue 3 years ago • 1 comments
trafficstars

Checklist

  • [X] My issue is specific & actionable.
  • [X] I am not suggesting a protocol enhancement.
  • [X] I have searched on the issue tracker for my issue.

Description

For reference about what this method is, see [1]

curl -X OPTIONS <gateway> -i should report the allowed HTTP methods. Having this doesn't seem to be required and websites seem to work just fine without. Same for regular gateway purposes as we know it now.

However... We're at the very least going to attempt to build WebDAV support in the gateway. For WebDAV this HTTP method is required [2]. If we need it anyway, we might as well add proper support while at it. Proper meaning:

  1. A options call to should advertise the usable options.
  2. If an invalid method is called we should respond with 405 [3]. Currently any invalid call is a 404 error (page not found)

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS [2] http://www.webdav.org/specs/rfc4918.html#HEADER_DAV [3] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow

markg85 avatar Mar 31 '22 16:03 markg85

Could this be done with a plugin?

guseggert avatar Sep 15 '22 15:09 guseggert

Hi @markg85 , what do you mean when you say "gateway"? Can you give an example in the command "curl -X OPTIONS <gateway> -i"?

patrickReiis avatar Oct 05 '23 15:10 patrickReiis

Ah, this issue still exists and is still open. Closed :)

@patrickReiis, Ipfs - kubo specifically - starts a gateway. The http endpoint to access ipfs. That thing is what i mean with <gateway>. so like https://ipfs.io and https://dweb.link are some examples.

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS for what the OPTIONS method should return. The IPFS gateway (the http server behind the scenes) doesn't give he output you should get.

This was for the webdav experiment. Which has been run and is open for discussion. As it stands, it doesn't look like webdav is going to be supported (support for the OPTIONS http-method would be a requirement there). So closing this as it's just not a point anymore.

markg85 avatar Oct 05 '23 16:10 markg85

Oh I see, thanks for replying. Now I'll look for another issue, hehe.

patrickReiis avatar Oct 05 '23 16:10 patrickReiis