rajt 0.0.46 → 0.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rajt",
3
3
  "description": "A serverless bundler layer, fully typed for AWS Lambda (Node.js and LLRT) and Cloudflare Workers.",
4
- "version": "0.0.46",
4
+ "version": "0.0.47",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "exports": {
package/src/auth/token.ts CHANGED
@@ -16,14 +16,14 @@ export class Token {
16
16
  const header = c.cx.req.header(this.#name) || c.cx.req.header('HTTP_AUTHORIZATION') || c.cx.req.header('REDIRECT_HTTP_AUTHORIZATION') || null
17
17
 
18
18
  if (header) {
19
- const position = header.toLowerCase().indexOf(this.#prefix.toLowerCase())
20
- if (position !== -1) {
21
- let token = header.slice(position + this.#prefix.length).trim()
22
- const commaPos = token.indexOf(',')
23
- if (commaPos !== -1) token = token.slice(0, commaPos).trim()
24
-
25
- return token
26
- }
19
+ const pos = header.toLowerCase().indexOf(this.#prefix.toLowerCase())
20
+ if (pos < 0) return header
21
+
22
+ let token = header.slice(pos + this.#prefix.length).trim()
23
+ const commaPos = token.indexOf(',')
24
+ if (commaPos > -1) token = token.slice(0, commaPos).trim()
25
+
26
+ return token
27
27
  }
28
28
 
29
29
  return null