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

Fix issues when the initial (cached) request is json #4

Closed
wants to merge 5 commits into from

Commits on Mar 8, 2016

  1. Tests demonstrating an issue when the initially cached response is json

    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.
    
    If subsequent requests don't want json output, then we successfully serve
    from the cache, but the cached content is json, rather than the expected
    string content.
    Carl Pacey committed Mar 8, 2016
    Configuration menu
    Copy the full SHA
    60642ca View commit details
    Browse the repository at this point in the history
  2. Fix issues when the initial (cached) request is json

    We JSON.parse and JSON.stringify the cached results as necessary.
    Carl Pacey committed Mar 8, 2016
    Configuration menu
    Copy the full SHA
    f9b2427 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2016

  1. Fix some whitespace issues in new tests

    Carl Pacey committed Mar 9, 2016
    Configuration menu
    Copy the full SHA
    fe1869c View commit details
    Browse the repository at this point in the history
  2. Fix an issue with modified cached json responses

    Previously, if any request handler modified a json response, then that
    modification would remain in the cache and be incorrectly returned in
    subsequent requests.
    
    With this change, we deep clone cached objects so each request handler gets
    its own copy of the original response.
    Carl Pacey committed Mar 9, 2016
    Configuration menu
    Copy the full SHA
    57e391c View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1 from cpacey/cpacey/json_fixes_plus

    Cpacey/json fixes plus
    Carl Pacey committed Mar 9, 2016
    Configuration menu
    Copy the full SHA
    9e5aca4 View commit details
    Browse the repository at this point in the history