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

@cpacey

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.

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