Commit 91f9b49
authored
ContainerRegistry: The registry may return a relative blob upload URL (#44)
Motivation
----------
In the 'Post then Put' blob upload method
(https://github.com/opencontainers/distribution-spec/blob/main/spec.md#post-then-put)
the client starts by making a POST request asking the registry to
start an upload session. The registry responds with a URL to which
the client should PUT the blob. The upload location might not be
provided by the registry server, allowing the registry to offload
storage to a different service.
Until now all registries we have encountered have returned absolute
upload URLs, however GHCR returns a relative URL causing uploads to
fail as reported in
#43.
Modifications
-------------
If the registry returns a relative URL, startBlobUpload() rewrites it
to be an absolute URL referring to the registry.
Result
------
Images can be pushed to GHCR and other registries which return relative
upload locations.
Test Plan
---------
Automated tests continue to pass.
Tested manually with GHCR and other known registries.
Fixes: #431 parent 90642df commit 91f9b49
1 file changed
+20
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
48 | 63 | | |
49 | 64 | | |
50 | 65 | | |
| |||
123 | 138 | | |
124 | 139 | | |
125 | 140 | | |
126 | | - | |
| 141 | + | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
130 | 145 | | |
131 | 146 | | |
132 | | - | |
133 | | - | |
| 147 | + | |
| 148 | + | |
134 | 149 | | |
135 | 150 | | |
136 | 151 | | |
| |||
0 commit comments