Commit 6efb914
Fix ENDPOINT_URL not exposed to Lua workers in nginx
nginx strips env vars from Lua workers unless declared with the 'env'
directive. ENDPOINT_URL was missing from nginx.conf.template, so
os.getenv('ENDPOINT_URL') always returned nil — the GCS backend
detection in PRESIGN_PART never fired and presigned part PUTs to GCS
always used the wrong canonical resource (with subresources).
- Add 'env ENDPOINT_URL;' to nginx.conf.template so Lua can read it.
- In PRESIGN_PART, move the '%3A' encoding inside the GCS branch so
standard S3 backends (cloudserver, Scaleway) keep literal ':' and
subresources in the canonical resource, while GCS gets '%3A' and
no subresources — matching what each backend verifies.
- Remove test_presign_upload_part_encodes_colons_in_url: the '%3A'
encoding is GCS-specific and cannot be asserted in CI (cloudserver).
The end-to-end round-trip test covers correctness for cloudserver.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 08d997e commit 6efb914
3 files changed
Lines changed: 13 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | 379 | | |
383 | 380 | | |
384 | 381 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
388 | 389 | | |
389 | | - | |
| 390 | + | |
390 | 391 | | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
| 395 | + | |
393 | 396 | | |
394 | 397 | | |
395 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 121 | | |
142 | 122 | | |
143 | 123 | | |
| |||
0 commit comments