Hello, I am getting the following error in Vercel logs:
Vercel Runtime Malformed Response Header Error: Header 'cf-ipcity: Luleå' contains non-ASCII characters..
I can't stop this header from being passed into vercel request headers, so looking for solutions.
I don't think UTF-8 in header values is something too uncommon. Even Vercel docs mention that UTF-8 is fine: https://vercel.com/docs/errors/MALFORMED_REQUEST_HEADER
- Validate UTF-8 encoding: Confirm that all request headers, especially cookie values, are valid UTF-8 strings. Non-UTF-8 characters in headers, particularly in the cookie header, often cause this error
Currently my Next.js does 2 things:
- it serves the frontend
- it rewrites some requests to get results from another service (which needs these headers).
Given UTF-8 headers are common, I think it's safe to assume it's a bug on Vercel side, but until it's fixed, how do I go around and patch it on my side?
Thank you.