Skip to content

Commit

Permalink
Meta: Prevent inf loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphsps committed Aug 27, 2024
1 parent d577a03 commit c203f22
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save-exact=true
loglevel=warn
fund=false
public-hoist-pattern[]=*@nordcom/nordstar*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21.x
10 changes: 10 additions & 0 deletions .renovaterc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>NordcomInc/renovate-config"
],
"gitIgnoredAuthors": [
"github-actions[bot]@users.noreply.github.com",
"[email protected]"
]
}
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const isValidUrl = (url: string) => {
const fallbackDomain = 'demo.nordcom.io'; // TODO.

const handleRequest = async (request: Request, _env: {}, ctx: ExecutionContext): Promise<Response> => {
if (request.headers.get('via') && /image-resizing/.test(request.headers.get('via')!)) {
return await fetch(request);
}

const accept = request.headers.get('accept');
const isWebp =
accept
Expand Down Expand Up @@ -63,6 +67,7 @@ const handleRequest = async (request: Request, _env: {}, ctx: ExecutionContext):
width: width!,
height: height!,
quality: quality ? parseInt(quality) : undefined,
metadata: 'copyright',
},
},
})
Expand Down

0 comments on commit c203f22

Please sign in to comment.