You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have deployed my app to a live server, with https, and useLocation() always returns "http:" as protocol. This leads to the following error where I need to change URL parameteres for certain pages:
DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://[...myURL]' cannot be created in a document with origin 'https://[...myURL]' and URL 'https://[...myURL]'.
At the moment, it looks like I'm gonna just to have use the standard document.location.
this is technically working as expected since useTask is running on the server and we pass the url from the server environment you're on. so in your adapter for your platform you can update the url to the correct url you want or it depends on which adapter you're deploying with
Is there anything I can do in this config to remedy the situation?
PatrickJS
changed the title
[🐞]useLocation() always returns "http" protocol, even though it is on https
[🐞] useLocation() always returns "http" protocol, even though it is on https
May 28, 2024
Hi,
I can relate to that problem. In my setup, the qwik application is running within a cluster, and there are multiple proxies in front of it. It is necessary to always include the X-Forwarded-ProtoHeader within your proxy settings. Qwik uses the header to change the protocol of the origin.
It was confusing because I always set the ORIGIN env variable, and requests sent directly to qwik (without going through the proxies) always returned the correct URL.
Which component is affected?
Qwik City (routing)
Describe the bug
I have deployed my app to a live server, with https, and useLocation() always returns "http:" as protocol. This leads to the following error where I need to change URL parameteres for certain pages:
DOMException: Failed to execute 'replaceState' on 'History': A history state object with URL 'http://[...myURL]' cannot be created in a document with origin 'https://[...myURL]' and URL 'https://[...myURL]'.
At the moment, it looks like I'm gonna just to have use the standard document.location.
Reproduction
https://stackblitz.com/edit/qwik-starter-ddc5id?file=src%2Froutes%2Findex.tsx
Steps to reproduce
Deply any code to a live server with https and console.log(location.url).
System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: