-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Astro.url.protocol returning http event when in https #5890
Comments
@GaspardCulis I believe you need to use the node adapter and have SSR enabled in your astro config |
I said in the issue I was using the node adapter, here is my config : export default defineConfig({ |
Ah I completely skipped it, I saw the repro didn't have it. |
Maybe try setting the vite config's |
Haven't configured that on codeblitz sorry did it quick and dirty. export default defineConfig({
output: 'server',
adapter: node({
mode: 'standalone',
}),
vite: {
optimizeDeps: {
exclude: ['postgres'],
},
server: {
https: true,
},
},
}); I was sure this would solve my issue, but it didn't sadly. So might be a bug / missing feature. |
Yeah, I'm experiencing the same, hence switched to https://github.com/rishi-raj-jain/rishi.app/blob/master/src/pages/api/search.js#L4 checks. |
Maybe we can do a config variable to set the protocol and hostname. |
Yeah, I mean I found an alternative to know which protocol my website is using, I just reported this issue because it seems like a bug that could be fixed |
What version of
astro
are you using?8.19.3
Are you using an SSR adapter? If so, which one?
Node adapter, standalone
What package manager are you using?
npm
What operating system are you using?
Arch Linux btw
Describe the Bug
In the --- ... --- zone (how do you call it ?) of an Astro page, I'm trying to access the current URL origin of my page using Astro.url.origin. It returns the good domain name, but prefixed with http, not https (I started my preview server with SERVER_KEY_PATH & SERVER_CERT_PATH env variables, https works fine in the browser). Same issue for Astro.url.protocol.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-8d8wxa?file=src%2Fpages%2Findex.astro,package.json&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: