Skip to content
Merged
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
12 changes: 0 additions & 12 deletions netlify/functions/reference-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ const { json, error, options, listBlobs, blobUrl, blobHeaders } = require("./hel

const STORE = "reference-context";

function authenticate(event) {
const auth = event.headers["authorization"] || event.headers["Authorization"] || "";
const token = auth.startsWith("Bearer ") ? auth.slice(7) : "";
if (!token || token !== process.env.NETLIFY_AUTH_TOKEN) {
return error("Unauthorized — provide Authorization: Bearer <NETLIFY_AUTH_TOKEN>", 401);
}
return null;
}

/**
* PUT /api/reference-context?name=my-dataset.zip&chunk=0&total=10
*
Expand Down Expand Up @@ -180,9 +171,6 @@ async function handleGet(event) {
exports.handler = async (event) => {
if (event.httpMethod === "OPTIONS") return options();

const authError = authenticate(event);
if (authError) return authError;

try {
if (event.httpMethod === "PUT") return await handlePut(event);
if (event.httpMethod === "GET") return await handleGet(event);
Expand Down
Loading