Close #3
This commit is contained in:
parent
9450ba3577
commit
11d1825dae
@ -611,7 +611,10 @@ export default {
|
|||||||
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
|
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
|
||||||
const { bucket } = env;
|
const { bucket } = env;
|
||||||
|
|
||||||
if (request.headers.get('Authorization') !== `Basic ${btoa(`${env.USERNAME}:${env.PASSWORD}`)}`) {
|
if (
|
||||||
|
request.method !== 'OPTIONS'
|
||||||
|
&& request.headers.get('Authorization') !== `Basic ${btoa(`${env.USERNAME}:${env.PASSWORD}`)}`
|
||||||
|
) {
|
||||||
return new Response('Unauthorized', {
|
return new Response('Unauthorized', {
|
||||||
status: 401,
|
status: 401,
|
||||||
headers: {
|
headers: {
|
||||||
|
Loading…
Reference in New Issue
Block a user