Skip to content

Commit f61dffd

Browse files
committed
docs(proxy): clarify forwarding metadata replacement
1 parent d661e92 commit f61dffd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎packages/proxy/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ the `Response` back. Three things the proxy relies on:
6767

6868
- `request.url` is the URL the client used. Upload tickets point clients at its origin. The first
6969
comma-separated `x-forwarded-proto` value overrides the scheme when it is `http` or `https`
70-
(case-insensitive). Configure your ingress to replace client-supplied values with the public
71-
scheme. When you construct `Request` objects, use the public URL and remove untrusted forwarding
70+
(case-insensitive). This value is client-controlled unless your ingress replaces it. Configure
71+
your ingress to replace client-supplied values with the public scheme rather than append to them.
72+
When you construct `Request` objects, use the public URL and remove untrusted forwarding
7273
headers before calling `handle`.
7374
- `request.signal` aborts when the client goes away. The proxy then cancels the daemon request, so
7475
work the client stopped waiting for does not keep running.

‎packages/proxy/src/daemon-proxy.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ export type DaemonProxy = {
8383
readonly instanceId: string;
8484
/**
8585
* Answers one client request. `request.url` must be the URL the client used, because upload
86-
* tickets are rewritten to its origin; an `x-forwarded-proto` header overrides its scheme.
86+
* tickets are rewritten to its origin. The first comma-separated `x-forwarded-proto` value
87+
* overrides its scheme when it is `http` or `https` (case-insensitive). This value is
88+
* client-controlled unless ingress replaces it with the public scheme. Replace rather than
89+
* append forwarding metadata, or remove untrusted headers and construct the public request URL.
8790
* Abort `request.signal` when the client goes away so in-flight daemon work is cancelled.
8891
* Resolves with an error response rather than rejecting.
8992
*/

0 commit comments

Comments
 (0)