Page MenuHomePhabricator

Allow proxy server to accept another valid http header instead of 'HOST'
Closed, ResolvedPublic

Description

Node 22 stabilizes the fetch API. It is now feature-compatible with browsers' fetch API. This is generally good, but it also adds more restrictions to what a valid HTTP request can be. The header field we are setting to pass the Wikipedia domain to that wiki proxy is HOST (see the configuration). This is problematic because HOST is a forbidden header.

So, the nodes fetch API won't accept the HOST header. The wiki proxy will receive the request without the HOST header and will return a 404 response.

Details

Event Timeline

Not sure under which team envoy falls in. It isn't listed in SRE. We need help to figure out a solution for this to unblock the migration to node22 for cxserver.

Change #1190253 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/services/cxserver@master] Use undic request when HOST header needed

https://gerrit.wikimedia.org/r/1190253

I 've already replied in T394982#11201112, but I find it improbable that SRE will be implementing such a behavior to accommodate for the change in node.js fetch() API. The HTTP Host header is pretty important across the infrastructure. Rewriting other HTTP headers to it might make debugging and reasoning more difficult than needed.

I 've already replied in T394982#11201112, but I find it improbable that SRE will be implementing such a behavior to accommodate for the change in node.js fetch() API. The HTTP Host header is pretty important across the infrastructure. Rewriting other HTTP headers to it might make debugging and reasoning more difficult than needed.

I agree; it is unreasonable to think we should work around limitations that exist for good reasons on the fetch API in browsers, but that make no sense for a backend program. Because it will only get worse over time, and I don't believe it's the right approach to service-to-service communication.

Nikerabbit claimed this task.

Thanks for the replies. Since there is now a way forward, I'm resolving this task.

Change #1190253 merged by jenkins-bot:

[mediawiki/services/cxserver@master] Use undici request instead of node fetch

https://gerrit.wikimedia.org/r/1190253