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

Content-Location with QUERY #1746

Closed
wants to merge 15 commits into from

Conversation

MikeBishop
Copy link
Contributor

Fixes #1745.

@mnot
Copy link
Member

mnot commented Oct 14, 2021

Content-Location doesn't indicate whether the resource on the other end will return these results in perpetuity, or whether it'll return the results to the query (which may change over time).

So it might be better to be explicit -- if the server wants to create a resource for these results, use 201 Created with Location that explicitly points to a resource that represents this query, and which can change over time. The server can choose whether to include the query results on the 201, of course.

@MikeBishop
Copy link
Contributor Author

Given that we're defining this method, it seems like we can specify which is the intended behavior, or provide mechanisms for each.

@asbjornu
Copy link

asbjornu commented Nov 2, 2022

Could perhaps a Link header be used to disambiguate the two use-cases?

Link: </updated-results>; rel="latest-version", </these-results>; rel="memento"

The chosen link relations are probably not appropriate, I just picked some that exists to provide a complete example.

@MikeBishop
Copy link
Contributor Author

MikeBishop commented Mar 21, 2024

Per discussion in Brisbane side-meeting:

  • Need to add text indicating what it means if the C-L target errors
  • Add text clarifying that the resource can be cached despite the different URI (this is cautioned against in SEMANTICS)
  • Security Considerations? Suggest that the URI SHOULD NOT expose the plaintext of the query contents (for Header to request always using QUERY over GET #1909)

@@ -200,6 +200,14 @@ q=foo&amp;limit=10&amp;sort=-published
using an HTTP GET request. Various non-normative examples of successful
QUERY responses are illustrated in <xref target="examples" />.
</t>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Contributor Author

@MikeBishop MikeBishop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review feedback from @reschke.

Copy link
Contributor

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see nothing here about cacheability or origins. I know that I left early, but I thought that we had concluded that the server claims about the Content-Location resource would be treated differently based on whether the indicated resource was on the same origin (or not).

A successful response to a QUERY request &MAY; include a Content-Location
header field (see <xref target="HTTP" section="8.7"/>) containing an
identifier for a specific resource corresponding to the results of the
operation. A client can send a GET request for the indicated URI to repeat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
operation. A client can send a GET request for the indicated URI to repeat
operation. A client can send a GET request for the indicated URI to repeat

So is this "A client can" or "This represents a claim from the server that a client can"

@MikeBishop
Copy link
Contributor Author

@martinthomson, I've added language restricting it to same-origin; is there a stronger statement you were expecting to see here?

Co-authored-by: Julian Reschke <julian.reschke@gmx.de>
@reschke
Copy link
Contributor

reschke commented May 24, 2024

@mnot , @royfielding , @martinthomson - should we go ahead with this?

@royfielding
Copy link
Member

No.

See #1745 (comment)

@reschke
Copy link
Contributor

reschke commented Jul 22, 2024

IETF 120 feedback: define both (the resource that identfies the result of this query), and a resource that can be used with GET to repeat the QUERY itself.

@reschke
Copy link
Contributor

reschke commented Jul 31, 2024

This looks good (right, @royfielding ?)

Looking at the PR, I was going to ask whether Location and Content-Location can be trailers, but found that this is consistent with RFC 9110.

Will have a look at the full text later to see how in integrates, and whether we may want to have more examples.

@reschke
Copy link
Contributor

reschke commented Aug 2, 2024

OK, I think we should add an example to section 4.

@MikeBishop - can you move this PR to the WG repo, so I can add to it?

@MikeBishop
Copy link
Contributor Author

@reschke, GitHub doesn't let me change the source branch of a PR, only the target. I've pushed the same branch to the upstream repo and opened #2851 with the same commit history. You should have full access to that one.

@MikeBishop MikeBishop closed this Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Describe role of Content-Location and Location fields
6 participants