Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarification: "Location" header bevahior? #79

Closed
rchincha opened this issue Jan 2, 2020 · 4 comments
Closed

clarification: "Location" header bevahior? #79

rchincha opened this issue Jan 2, 2020 · 4 comments

Comments

@rchincha
Copy link
Contributor

rchincha commented Jan 2, 2020

As per spec, "Location" header is typically of the form:
Location: /v2//blobs/uploads/<session_id>

Also,

Though the URI format (/v2/<name>/blobs/uploads/<session_id>) for the Location header is specified, clients SHOULD treat it as an opaque url and SHOULD never try to assemble it.

However, docker distribution appears to return a fully qualified "Location" header value of the form:
https://<server_ip>:<server_port>/v2//blobs/uploads/<session_id>

This behavior needs further clarification. What should be a compliant client's expectation from the server? In one case, it needs to prepend the Location header with the (scheme,address,port) and in the other, not.

@jonjohnsonjr
Copy link
Contributor

I think we can just defer to RFC 7231:

The field value consists of a single URI-reference. When it has the
form of a relative reference ([RFC3986], Section 4.2), the final
value is computed by resolving it against the effective request URI
([RFC3986], Section 5).

@rchincha
Copy link
Contributor Author

rchincha commented Jan 3, 2020

So this would mean the client needs to distinguish between the two Location formats, which is fine. Should this be called out in the dist-spec?

@jzelinskie
Copy link
Member

Absolutely. We should add a link to the RFC in all the tables that document the headers for endpoints -- some of them are even empty for Location.

rchincha added a commit to rchincha/distribution-spec that referenced this issue Jan 6, 2020
From the spec it is not clear how the `Location` header must be set.
This comment clarifies the behavior.

Fixes issue opencontainers#79
rchincha added a commit to rchincha/distribution-spec that referenced this issue Jan 6, 2020
From the spec it is not clear how the `Location` header must be set.
This comment clarifies the behavior.

Fixes issue opencontainers#79

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
rchincha added a commit to rchincha/distribution-spec that referenced this issue Jan 7, 2020
From the spec it is not clear how the `Location` header must be set.
This comment clarifies the behavior.

Fixes issue opencontainers#79

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
@jzelinskie jzelinskie added this to the v1.0.0-rc1 milestone May 6, 2020
@jdolitsky jdolitsky modified the milestones: v1.0.0-rc1, v1.0.0-rc2 Oct 7, 2020
@jdolitsky
Copy link
Member

Resolved by #206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants