google / webpackager

Apache License 2.0
71 stars 20 forks source link

Option for webpkgserver to relay custom headers #114

Open sandyandi opened 1 year ago

sandyandi commented 1 year ago

Hi!

We have simple firewall that blocks non-browser requests to our websites by checking the user-agent request header. Requests from webpkgserver gets blocked as it uses Go's http client as user-agent.

We use Nginx to proxy pass to webpkgserver. Eg:

proxy_pass http://127.0.0.1:8080/priv/doc/https://example.com/foo.html;

We're wondering if it's possible for use add custom request header that gets relayed to https://example.com/foo.html so we can use it header to unblock requests from webpkgserver.

With the config below:

proxy_pass    http://127.0.0.1:8080/priv/doc/https://example.com/foo.html;
proxy_set_header    X-Is-WebPackager    1

we expect to have all requests from webpkgserver to https://example.com/foo.html will have the X-Is-WebPackager: 1 header. But, the custom header is not present which results in the request being blocked by firewall.

Is it by design?