Browse Source

handleGET: hide S3 bucket responses

master
Peter Cai 9 months ago
parent
commit
3b1602d2bc
  1. 12
      src/index.coffee

12
src/index.coffee

@ -37,7 +37,17 @@ handleGET = (request) ->
return new Response "Invalid URL",
status: 404
return await s3.getObject url.pathname[1...], {}
resp = await s3.getObject url.pathname[1...], {}
if not resp.ok
headers = new Headers resp.headers
headers.set "Content-Length", 0
return new Response null,
status: resp.status
statusText: resp.statusText
headers: headers
else
return resp
handlePUT = (request) ->
url = new URL request.url

Loading…
Cancel
Save