Skip to content

Preserve request precondition headers in NoCache#1098

Open
puneetdixit200 wants to merge 1 commit into
go-chi:masterfrom
puneetdixit200:fix/801-nocache-preconditions
Open

Preserve request precondition headers in NoCache#1098
puneetdixit200 wants to merge 1 commit into
go-chi:masterfrom
puneetdixit200:fix/801-nocache-preconditions

Conversation

@puneetdixit200

Copy link
Copy Markdown

Summary

  • stop NoCache from deleting conditional request headers such as If-Match and If-None-Match
  • add a regression test that confirms precondition headers reach downstream handlers while no-cache response headers are still set

Fixes #801.

Tests

  • GOMODCACHE=/tmp/chi-801-gomodcache GOCACHE=/tmp/chi-801-gocache go test ./middleware -run TestNoCachePreservesRequestPreconditionHeaders -count=1
  • GOMODCACHE=/tmp/chi-801-gomodcache GOCACHE=/tmp/chi-801-gocache go test ./middleware -run 'NoCache|TestNoCachePreservesRequestPreconditionHeaders' -count=1
  • GOMODCACHE=/tmp/chi-801-gomodcache GOCACHE=/tmp/chi-801-gocache go test ./middleware -count=1
  • GOMODCACHE=/tmp/chi-801-gomodcache GOCACHE=/tmp/chi-801-gocache go test ./... -count=1
  • git diff --check

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

Successfully merging this pull request may close these issues.

NoCache middlewares should not remove preconditions from request

1 participant