MCPcopy Index your code
hub / github.com/browserless/browserless / getTokenFromRequest

Function getTokenFromRequest

src/utils.ts:247–251  ·  view source on GitHub ↗
(req: Request)

Source from the content-addressed store, hash-verified

245 });
246
247export const getTokenFromRequest = (req: Request) => {
248 const authHeader = req.headers.authorization;
249 const tokenParam = req.parsed.searchParams.get('token');
250 return tokenParam ?? getAuthHeaderToken(authHeader || '');
251};
252
253// NOTE, if proxying request elsewhere, you must re-stream the body again
254export const readRequestBody = async (

Callers 2

isAuthorizedMethod · 0.85
handler.tsFile · 0.85

Calls 2

getAuthHeaderTokenFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected