Answer the question
In order to leave comments, you need to log in
Why is req.headers encoding wrong?
I can not solve the problem for the second day. I am writing a project on Nuxt.js. I call NextServerInit, and from it I send http headers to the server. And the essence of the problem is that Russian letters are in the wrong encoding. It seems to be like utf8 converted to windows-1252. Here's what it looks like.
{ 10:38:04
host: 'v2.dev.xn--80aaepkoa4atsc1i0b.xn--p1ai',
'x-forwarded-proto': 'https',
connection: 'close',
'x-real-ip': '46.242.10.108',
'x-geoip-country-code': 'RU',
'x-geoip-country-name': 'Russia',
'x-geoip-country-name-ru': 'РоÑÑиÑ',
'x-geoip-region': 'MOW',
'x-geoip-city': 'Moscow',
'x-geoip-city-ru': 'ÐоÑква',
'x-geoip-postal-code': '101194',
'x-geoip-latitude': '55.74850',
'x-geoip-longitude': '37.61840'
}
export const actions = {
async nuxtServerInit({commit}, {redirect, req}) {
console.log(req.headers);
return axios.post(API_ENDPOINT, ....);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question