Skip to content

Commit 9311f12

Browse files
committed
support PUT and DELETE
1 parent 33138ce commit 9311f12

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

common/docker-entrypoint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export CORS_ENABLED="$(parseBoolean "${CORS_ENABLED}")"
5757
# is not normally used as part of the gateway. The following variable
5858
# defines the set of acceptable headers.
5959
if [ "${CORS_ENABLED}" == "1" ]; then
60-
export LIMIT_METHODS_TO="GET HEAD OPTIONS"
61-
export LIMIT_METHODS_TO_CSV="GET, HEAD, OPTIONS"
60+
export LIMIT_METHODS_TO="GET HEAD OPTIONS PUT DELETE"
61+
export LIMIT_METHODS_TO_CSV="GET, HEAD, OPTIONS, PUT, DELETE"
6262
else
63-
export LIMIT_METHODS_TO="GET HEAD"
64-
export LIMIT_METHODS_TO_CSV="GET, HEAD"
63+
export LIMIT_METHODS_TO="GET HEAD PUT DELETE"
64+
export LIMIT_METHODS_TO_CSV="GET, HEAD, PUT, DELETE"
6565
fi
6666

6767
if [ -z "${CORS_ALLOWED_ORIGIN+x}" ]; then

common/etc/nginx/include/s3gateway.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,6 @@ function _s3DirQueryParams(uriPath, method) {
366366
* @param r {NginxHTTPRequest} HTTP request object
367367
*/
368368
function redirectToS3(r) {
369-
// This is a read-only S3 gateway, so we do not support any other methods
370-
if (!(r.method === 'GET' || r.method === 'HEAD')) {
371-
utils.debug_log(r, 'Invalid method requested: ' + r.method);
372-
r.internalRedirect("@error405");
373-
return;
374-
}
375-
376369
const uriPath = r.variables.uri_path;
377370
const isDirectoryListing = ALLOW_LISTING && _isDirectory(uriPath);
378371

0 commit comments

Comments
 (0)