Skip to content

Commit

Permalink
redirect to resume pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
shaiq-dev committed Mar 12, 2024
1 parent 05d8bf1 commit d3c115b
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions lambda/resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
export const handler = async (event, context) => {
try {

const allowedOrigins = process.env.ALLOWED_ORIGINS.split(",") || []
const origin = event.headers.Origin || event.headers.origin;

if (!allowedOrigins.includes(origin)) {
return {
statusCode: 401,
body: JSON.stringify({
status: 'ACCESS_DENIED',
}),
}
}

const s3 = new S3Client();
const bucket = process.env.BUCKET

Expand All @@ -39,9 +27,10 @@ export const handler = async (event, context) => {
}));

return {
statusCode: 200,
statusCode: 302,
headers: {
"Access-Control-Allow-Origin": origin,
"Location": url,
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Credentials": true,
},
body: JSON.stringify({
Expand Down

0 comments on commit d3c115b

Please sign in to comment.