14 Commits

Author SHA1 Message Date
Greg Karékinian
71d138894e Validate the Content-Type on PUT requests
Return a 415
(https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415) when the
Content-Type does not look like a valid MIME type (in the type/subtype
format)

Refs #137
2020-04-15 13:49:33 +02:00
Greg Karékinian
1824766a03 Implement Range support for the Swift provider, with specs 2020-01-06 14:03:26 +01:00
Greg Karékinian
8c95e804ca Add support for partial responses
Set the Content-Range response header and return a 206 status if it is a
partial response (a Range was passed)
2020-01-02 18:24:12 +01:00
Garret Alfert
575f4a87be Set the response headers from Redis metadata on GET 2018-11-26 11:33:21 +01:00
Greg Karékinian
b4ad4c4793 Set the Content-Length on a HEAD requests
We get it as part of the Redis metadata

RFC: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
2018-05-22 12:44:24 +02:00
Garret Alfert
533c9b6346 Set Content-type header on HEAD requests
Fixes #121
2018-05-22 11:59:55 +02:00
Greg Karékinian
639c3724f0 Refactor the put_request method to have a return value 2018-05-09 16:01:14 +02:00
Greg Karékinian
f14ef4dc21 Consider that the metadata has changed when the Last-Modified changes
Also adds a spec for it
2018-04-30 16:39:12 +02:00
Greg Karékinian
3b72b8d0bb Pass the headers to the set_response_headers directly, not the response 2018-04-30 15:12:53 +02:00
Greg Karékinian
b00fc5bee2 Reverse the not found logic in the delete_data method to make it clearer 2018-04-30 15:10:55 +02:00
Greg Karékinian
21dad2aba7 Get the metadata from Redis on a HEAD request
No need to hit the storage backend, we can set the response headers from
the data in Redis
2018-04-26 13:17:43 +02:00
Greg Karékinian
7bd45543f6 Set headers from the Redis metadata on a GET that results in a 304
Also add specs to check for the response headers
2018-04-26 13:17:43 +02:00
Greg Karékinian
f083022e6d Get the ETag from Redis on a GET request
This prevents doing a network request when we would return a 304 anyway
2018-04-26 13:17:43 +02:00
Greg Karékinian
86dc45f444 Add support for S3 through the REST API
This is currently using the old S3 authentication
(https://s3.amazonaws.com/doc/s3-developer-guide/RESTAuthentication.html),
in order to support Exoscale Storage

Refs #112
2018-04-26 13:17:43 +02:00