Server side rendered locale switching links will always start with http
See original GitHub issueVersion
Reproduction link
-
Steps to reproduce
What is expected ?
What is actually happening?
Additional comments?
In https://github.com/nuxt-community/nuxt-i18n/blob/e2aa687083873b6cb20b29beb044db8572e223cf/src/plugins/routing.js#L56 req.secure
is used, which is only defined in Express, but SSR context only provides Node’s http.IncomingMessage
which does not contain such property, resulting in any of the links generated by switchLocalePath
server side to start with http
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Server side rendered locale switching links will always start ...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity...
Read more >Localized Server-Side Rendering with React | Phrase
When handling a request, our Express server will often be given an Accept-Language HTTP header. This header contains a list of the locales...
Read more >How does server side internationalization (i18n) look like? de
In this blog post we will shed light on the server side. Why do I need to handle i18n in my application's backend?...
Read more >react-router Link doesn't render href attribute with server side ...
Inside Hello component i am using two react-router Links, but these two Links doesn't render the href attributes. I am using here react-router...
Read more >Advanced Features: Internationalized Routing - Next.js
When a user visits the application root (generally / ), Next.js will try to automatically detect which locale the user prefers based on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Checking protocol can be easily done for this module:
https://github.com/nuxt-community/is-https
Which is already used by sitemap module
The logic is not that big (https://github.com/expressjs/express/blob/b8e50568af9c73ef1ade434e92c60d389868361d/lib/request.js#L306) but:
proxy-addr
dependencytrust proxy
in expressjs provides here https://expressjs.com/en/4x/api.html#trust.proxy.options.table)It feels kinda wrong to have to have all that in nuxt-i18n itself. It would be better if nuxt itself took care of those things. I wished nuxt used expressjs instead of connect…