File tree 2 files changed +11
-15
lines changed
2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,17 @@ import { NextResponse, NextRequest } from "next/server"
6
6
7
7
import { getToken } from "../jwt"
8
8
import parseUrl from "../utils/parse-url"
9
- import { detectHost } from "../utils/web"
9
+
10
+ // // TODO: Remove
11
+ /** Extract the host from the environment */
12
+ export function detectHost (
13
+ trusted : boolean ,
14
+ forwardedValue : string | null ,
15
+ defaultValue : string | false
16
+ ) : string | undefined {
17
+ if ( trusted && forwardedValue ) return forwardedValue
18
+ return defaultValue || undefined
19
+ }
10
20
11
21
type AuthorizedCallback = ( params : {
12
22
token : JWT | null
Original file line number Diff line number Diff line change @@ -119,17 +119,3 @@ export function toResponse(res: ResponseInternal): Response {
119
119
120
120
return response
121
121
}
122
-
123
- // TODO: Remove
124
- /** Extract the host from the environment */
125
- export function detectHost (
126
- trusted : boolean ,
127
- forwardedValue : string | string [ ] | undefined | null ,
128
- defaultValue : string | false
129
- ) : string | undefined {
130
- if ( trusted && forwardedValue ) {
131
- return Array . isArray ( forwardedValue ) ? forwardedValue [ 0 ] : forwardedValue
132
- }
133
-
134
- return defaultValue || undefined
135
- }
You can’t perform that action at this time.
0 commit comments