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

Initial json requests cause subsequent requests to behave unexpectedly #3

Description

@cpacey

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions