-
Is there any way to get the origin header/request object in the |
Beta Was this translation helpful? Give feedback.
Answered by
kwhitley
Mar 4, 2022
Replies: 1 comment
-
Sorry I'm just now seeing this! Wish GH would add badges next to Discussions for unanswered ones... Perhaps try something like this? // index.js
import { Router } from 'itty-router'
import { error } from 'itty-router-extras'
const router = Router()
// add routes (not shown)
export default {
fetch: (request, ...args) => router
.handle(request, ...args)
.catch((err) => {
const referer = request.headers.get('Referer')
// do something with it
return error(500, 'Not really a 500, but you get the point')
})
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
EduM22
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry I'm just now seeing this! Wish GH would add badges next to Discussions for unanswered ones...
Perhaps try something like this?