Skip to content

Commit

Permalink
Fix error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
exvuma authored and lukeed committed Sep 26, 2019
1 parent 5872bbe commit a700f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker-sites/workers-site/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ addEventListener('fetch', event => {

async function handleEvent(event) {
const url = new URL(event.request.url)
try {
let options = {
// customize how incoming requests will map to assets
mapRequestToAsset: request => {
Expand All @@ -33,6 +32,7 @@ async function handleEvent(event) {
return new Request(url.toString(), defaultAssetKey)
},
}
try {
if (DEBUG) {
// customize caching
options.cacheControl = {
Expand All @@ -46,7 +46,7 @@ async function handleEvent(event) {
status: 404,
})
} else {
return new Response(`"${mapRequestToAsset(url.pathname)}" not found`, {
return new Response(`"${options.mapRequestToAsset(event.request).url}" not found`, {
status: 404,
})
}
Expand Down

0 comments on commit a700f96

Please sign in to comment.