Commit 3eb5fdf
committed
Fix ranged GET signing failure with Cloudflare R2
GetObjectRange was missing from the skip-list in headers(), so it fell
through to the catch-all arm that adds content-length and content-type.
For GET requests these headers are empty/meaningless, but they still get
included in the canonical request signature. Cloudflare R2 rejects the
resulting signature (SignatureDoesNotMatch), while AWS S3 happens to
tolerate it.
Instead of maintaining a skip-list of commands that should not include
body headers, this switches to checking http_verb(): only PUT, POST and
DELETE may carry a body, so only those get content-length/content-type.
This also prevents the same bug from happening if new GET-like commands
are added in the future.1 parent 3a9314f commit 3eb5fdf
1 file changed
+12
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
713 | 714 | | |
714 | 715 | | |
715 | 716 | | |
| |||
0 commit comments