Skip to content

Astro.url.protocol returning http event when in https #5890

@GaspardCulis

Description

@GaspardCulis

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

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions