ShallowEtagHeaderFilter can now handle the If-Match HTTP Header for cond... #215

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@eugenp
eugenp commented Jan 13, 2013

...itional GET requests

Few notes:

  • this is also being tracked on JIRA: SPR-10164
  • the changes (can only) deal with read operations (GET); the shallow implementation cannot handle conditional PUT operations, since it would have to determine IF the filter chain can be executed and STOP it in case it should not be - which is not possible
  • the if-else nesting in updateResponse is a bit to deep (3 levels) - I can extract out the logic handling the If-None-Match and the logic handling If-Match
  • the original implementation only handled If-None-Match so I had to rename a few variables to accomodate the new code path for If-Match

Thanks.

@rstoyanchev
Contributor

Have you signed the contributor's agreement already? See the contributing wiki.

@eugenp
eugenp commented Jan 14, 2013

I have, yes - not sure how to check the end result, but it's signed:
I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.

@rstoyanchev
Contributor

Ok thanks for confirming.

@rstoyanchev
Contributor

Sorry for taking a long time to look into this.

It seems that If-Match is useful for PUT operations to ensure an entity is updated only if it wasn't changed by anyone else meanwhile (aka optimistic locking). However, the filter doesn't support PUT by design since it only does it's checks after the response is written (hence the name "Shallow"). So I'm curious how do you actually use the fix suggested in this PR? What use cases does it cover for you?

@rstoyanchev
Contributor

/cc @eugenp, just in case you didn't get a notification on the above comment.

@eugenp
eugenp commented Sep 25, 2013

Hi @rstoyanchev - I'm on holiday right now with very sporadic internet access, so I'll look into this (and edit this comment with the answer) just as soon as I get back home. Thanks. Eugen.

@rstoyanchev
Contributor

Okay thanks

@philwebb philwebb was assigned Oct 21, 2013
@philwebb
Member

I am going to close this one for now until we have a little more understanding about the use-case this covers.

@philwebb philwebb closed this Oct 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment