Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support PUT and DELETE #349

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading