Skip to content

Commit

Permalink
Move context.next() call after first return in referrer.js to try and…
Browse files Browse the repository at this point in the history
… speed up blog pages
  • Loading branch information
whitep4nth3r committed Feb 28, 2024
1 parent 14a9040 commit 40a7637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mk2-p4nth3rblog",
"version": "1.0.2",
"version": "1.0.3",
"description": "My website and blog.",
"scripts": {
"watch:sass": "sass --watch ./src/_sass:src/_css",
Expand Down
6 changes: 3 additions & 3 deletions src/_edge-functions/referer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export default async (request, context) => {
// get HTTP referer header
const referer = request.headers.get("referer");

// get the next HTTP response in the chain
const response = await context.next();

// if no referer, return the response
if (referer === null) {
return;
}

// get the next HTTP response in the chain
const response = await context.next();

// get keys from refererMessages
const refererKeys = Array.from(Object.keys(messages));

Expand Down

0 comments on commit 40a7637

Please sign in to comment.