Skip to content

Commit

Permalink
support PUT and DELETE
Browse files Browse the repository at this point in the history
  • Loading branch information
ATGardner committed Dec 11, 2024
1 parent 33138ce commit 9311f12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 4 additions & 4 deletions common/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export CORS_ENABLED="$(parseBoolean "${CORS_ENABLED}")"
# is not normally used as part of the gateway. The following variable
# defines the set of acceptable headers.
if [ "${CORS_ENABLED}" == "1" ]; then
export LIMIT_METHODS_TO="GET HEAD OPTIONS"
export LIMIT_METHODS_TO_CSV="GET, HEAD, OPTIONS"
export LIMIT_METHODS_TO="GET HEAD OPTIONS PUT DELETE"
export LIMIT_METHODS_TO_CSV="GET, HEAD, OPTIONS, PUT, DELETE"
else
export LIMIT_METHODS_TO="GET HEAD"
export LIMIT_METHODS_TO_CSV="GET, HEAD"
export LIMIT_METHODS_TO="GET HEAD PUT DELETE"
export LIMIT_METHODS_TO_CSV="GET, HEAD, PUT, DELETE"
fi

if [ -z "${CORS_ALLOWED_ORIGIN+x}" ]; then
Expand Down
7 changes: 0 additions & 7 deletions common/etc/nginx/include/s3gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,6 @@ function _s3DirQueryParams(uriPath, method) {
* @param r {NginxHTTPRequest} HTTP request object
*/
function redirectToS3(r) {
// This is a read-only S3 gateway, so we do not support any other methods
if (!(r.method === 'GET' || r.method === 'HEAD')) {
utils.debug_log(r, 'Invalid method requested: ' + r.method);
r.internalRedirect("@error405");
return;
}

const uriPath = r.variables.uri_path;
const isDirectoryListing = ALLOW_LISTING && _isDirectory(uriPath);

Expand Down

0 comments on commit 9311f12

Please sign in to comment.