Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Initial json requests cause subsequent requests to behave unexpectedly #3

Open
cpacey opened this issue Mar 8, 2016 · 0 comments
Open

Comments

@cpacey
Copy link

cpacey commented Mar 8, 2016

These only happen if the initially-cached request has options.json = true.

  1. If subsequent requests want json output (options.json = true), then we try to JSON.parse() the cached content, which is already json, which throws. This causes the cache lookup to fail, so we go get from source again.
  2. If subsequent requests don't want json output (options.json = false), then we successfully serve from the cache, but the cached content is json, rather than the expected string content.

I've written some tests demonstrating these behaviours.

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

No branches or pull requests

1 participant