Skip to content

Commit

Permalink
fix(useContentHead): disable host detection
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jan 26, 2023
1 parent 801535d commit f6a429d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/runtime/composables/head.ts
Expand Up @@ -34,14 +34,14 @@ export const useContentHead = (
}
}

let host = config.public.content.host
if (process.server && !host) {
const req = useRequestEvent().node?.req
if (req) {
const protocol = req.headers['x-forwarded-proto'] || req.connection.encrypted ? 'https' : 'http'
host = `${protocol}://${req.headers.host}`
}
}
const host = config.public.content.host
// if (process.server && !host) {
// const req = useRequestEvent().node?.req
// if (req && req.headers.host !== 'localhost') {
// const protocol = req.headers['x-forwarded-proto'] || req.connection.encrypted ? 'https' : 'http'
// host = `${protocol}://${req.headers.host}`
// }
// }
if (process.server && host) {
const _url = joinURL(host ?? '/', config.app.baseURL, to.fullPath)
const url = config.public.content.trailingSlash ? withTrailingSlash(_url) : withoutTrailingSlash(_url)
Expand Down

0 comments on commit f6a429d

Please sign in to comment.