alphagov/cdn-acceptance-tests — pull request #76 by dcarley (2014-07-29 07:51:55+00:00)
Title: More cache feature tests

#### Add TestCacheUniqueQueryParams

Per the test comment. This should never happen in Fastly, but Cloudflare
(and Akamai IIRC) have cache configuration level called "basic" that will
disregard the query param as a cache key.

Technically this should be picked up by all of our tests because the helper
uses the same path but different query params for each test. But it's better
to be explicit about it, especially if we change the helper in future. Hence
the additional assertions about req.URL.Path.

#### Add TestCacheUniqueCaseSensitive

Per the test comment. This was a feature that we once enabled in Akamai and
subsequently forgot about; it lead to some very non-deterministic behaviour
and took us a while to pluck up the courage to turn it off. We should
safeguard against this happening again in the future.

I went down a bit of a rabbit-warren trying to figure out how to deep-copy
*http.Request and *url.URL objects with pointer deferences. It turned out to
be much easier to just create two requests and set their respective Path and
RawQuery fields. The first two assertions check that this has actually
worked. The other parts of the request shouldn't matter.