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

BundleRequestHandler<TBundle> compares ETags incorrectly #26

Open
mattk- opened this issue Jun 21, 2014 · 1 comment
Open

BundleRequestHandler<TBundle> compares ETags incorrectly #26

mattk- opened this issue Jun 21, 2014 · 1 comment

Comments

@mattk-
Copy link

mattk- commented Jun 21, 2014

var actualETag = "\"" + bundle.Hash.ToHexString() + "\"";
var givenETag = context.Request.Headers["If-None-Match"];

if(givenETag.Equals(actualETag))
  ...

actualETag is a string but givenETag is IEnumerable<string>.

I think it should compare actualETag with context.Request.Headers["If-None-Match"].FirstOrDefault()

Current implementation means unchanged resources are returned with 200 when it should be 304.

@kenchilada
Copy link

I ran into the same bug, came up with the same fix, came to post this same issue.

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

No branches or pull requests

2 participants