Skip to content

Commit f6a429d

Browse files
committed
fix(useContentHead): disable host detection
1 parent 801535d commit f6a429d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/runtime/composables/head.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export const useContentHead = (
3434
}
3535
}
3636

37-
let host = config.public.content.host
38-
if (process.server && !host) {
39-
const req = useRequestEvent().node?.req
40-
if (req) {
41-
const protocol = req.headers['x-forwarded-proto'] || req.connection.encrypted ? 'https' : 'http'
42-
host = `${protocol}://${req.headers.host}`
43-
}
44-
}
37+
const host = config.public.content.host
38+
// if (process.server && !host) {
39+
// const req = useRequestEvent().node?.req
40+
// if (req && req.headers.host !== 'localhost') {
41+
// const protocol = req.headers['x-forwarded-proto'] || req.connection.encrypted ? 'https' : 'http'
42+
// host = `${protocol}://${req.headers.host}`
43+
// }
44+
// }
4545
if (process.server && host) {
4646
const _url = joinURL(host ?? '/', config.app.baseURL, to.fullPath)
4747
const url = config.public.content.trailingSlash ? withTrailingSlash(_url) : withoutTrailingSlash(_url)

0 commit comments

Comments
 (0)