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

Etag extraction from header incomplete? #169

Open
Pfeil opened this issue Apr 28, 2023 · 1 comment
Open

Etag extraction from header incomplete? #169

Pfeil opened this issue Apr 28, 2023 · 1 comment
Labels
documentation needs further investigation Something that requires a closer look, maybe later in time

Comments

@Pfeil
Copy link
Member

Pfeil commented Apr 28, 2023

Describe the bug

The method ControllerUtils::getEtagFromHeader is supposed to extract the Etag, but it only checks the If-Match
header, which makes it interesting for updating resources only.

String etagValue = request.getHeader("If-Match");

According to this article, another header may be relevant in other cases, although spring usually handles this for us.

Using an If-* header turns a standard GET request into a conditional GET. The two If-* headers that are using with ETags are “If-None-Match” and “If-Match” – each with its own semantics as discussed later in this article.

The linked RFC in the article is an outdated draft, the current version is here. Both mention the "*" wildcard, and supporting a list of etags. Not sure but I think we do not support this (in this manual check, at least. Spring probably does.)

To Reproduce

Nothing to reproduce. I found it while checking available utilities.

Expected behavior

  • The documentation should make clear that this function is only appropriate for update cases / the if-match header.
  • There could be a function handling multiple values and wildcard ("*"). This function may be used for different check functions, like the ones already provided.

Screenshots

None. Check out the links to the source code and the article above.

Desktop (please complete the following information):

Independent. Just talking about the source code here.

Additional context

none

@Pfeil Pfeil added bug Something isn't working needs further investigation Something that requires a closer look, maybe later in time documentation and removed bug Something isn't working labels Apr 28, 2023
@ThomasJejkal
Copy link
Contributor

Well, so far ETags were indeed only used for update and delete operations. I agree, that for caching also the mentioned option could be relevant, but at the moment we do not have scenarios where we have to rely on caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation needs further investigation Something that requires a closer look, maybe later in time
Projects
None yet
Development

No branches or pull requests

2 participants