Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

Conversation

@oliverpool
Copy link
Contributor

Closes #151

@oliverpool
Copy link
Contributor Author

@signalnerve here it is :)

Copy link
Contributor

@Cherry Cherry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cherry
Copy link
Contributor

Cherry commented May 18, 2021

Waiting on Github Actions to recover (https://www.githubstatus.com/), and then I'll merge this. 👍

@kristianfreeman
Copy link
Contributor

Ran tests locally to ensure that things work!

6c0dd6d ~/src/kv-asset-handler> npm test

> @cloudflare/[email protected] pretest /Users/kristianfreeman/src/kv-asset-handler
> npm run build


> @cloudflare/[email protected] build /Users/kristianfreeman/src/kv-asset-handler
> tsc -d


> @cloudflare/[email protected] test /Users/kristianfreeman/src/kv-asset-handler
> ava dist/test/*.js --verbose


  ✔ mapRequestToAsset › mapRequestToAsset() correctly changes /about -> /about/index.html
  ✔ mapRequestToAsset › mapRequestToAsset() correctly changes /about/ -> /about/index.html
  ✔ mapRequestToAsset › mapRequestToAsset() correctly changes /about.me/ -> /about.me/index.html
  ✔ serveSinglePageApp › serveSinglePageApp returns root asset path when request path ends in .html
  ✔ serveSinglePageApp › serveSinglePageApp returns root asset path when request path does not have extension
  ✔ serveSinglePageApp › serveSinglePageApp returns requested asset when request path has non-html extension
Environment doesnt support readable streams
Environment doesnt support readable streams
  - getAssetFromKV › getAssetFromKV when body not empty, should invoke .cancel()
  ✔ getAssetFromKV › getAssetFromKV does not cache on Cloudflare when bypass cache set
  ✔ getAssetFromKV › getAssetFromKV if not in asset manifest still returns nohash.txt
  ✔ getAssetFromKV › getAssetFromKV when setting browser caching
  ✔ getAssetFromKV › getAssetFromKV when namespace not bound fails
  ✔ getAssetFromKV › getAssetFromKV return correct val from KV and default caching
  ✔ getAssetFromKV › getAssetFromKV evaluated the file matching the extensionless path first /client/ -> client
  ✔ getAssetFromKV › getAssetFromKV evaluated the file matching the extensionless path first /client -> client
  ✔ getAssetFromKV › getAssetFromKV if no asset manifest /client -> client fails
  ✔ getAssetFromKV › getAssetFromKV if sub/ -> sub/index.html served
  ✔ getAssetFromKV › getAssetFromKV gets index.html by default for / requests
  ✔ getAssetFromKV › getAssetFromKV non ASCII path support
  ✔ getAssetFromKV › getAssetFromKV supports browser percent encoded URLs
  ✔ getAssetFromKV › getAssetFromKV supports user percent encoded URLs
  ✔ getAssetFromKV › getAssetFromKV custom key modifier
  ✔ getAssetFromKV › getAssetFromKV with no trailing slash on root
  ✔ getAssetFromKV › getAssetFromKV with no trailing slash on a subdirectory
  ✔ getAssetFromKV › getAssetFromKV no result throws an error
  ✔ getAssetFromKV › getAssetFromKV passing in a custom NAMESPACE serves correct asset
  ✔ getAssetFromKV › getAssetFromKV when setting custom cache setting
  ✔ getAssetFromKV › getAssetFromKV when custom namespace without the asset should fail
  ✔ getAssetFromKV › getAssetFromKV only decode URL when necessary
  ✔ getAssetFromKV › getAssetFromKV when etag and if-none-match are present but if-none-match !== etag, should bypass cache
  ✔ getAssetFromKV › getAssetFromKV caches on two sequential requests
  ✔ getAssetFromKV › getAssetFromKV if-none-match not sent but resource in cache, should return hit
  ✔ getAssetFromKV › getAssetFromKV if range request submitted and resource in cache, request fulfilled
  ✔ getAssetFromKV › getAssetFromKV TTls set to null should not cache on browser or edge (112ms)
  ✔ getAssetFromKV › getAssetFromKV does not store max-age on two sequential requests (118ms)
  ✔ getAssetFromKV › getAssetFromKV when if-none-match === etag and etag === pathKey in manifest, should revalidate (109ms)
Environment doesnt support readable streams
Environment doesnt support readable streams
  ─

  34 tests passed
  1 test todo

@kristianfreeman kristianfreeman merged commit 2b3e308 into cloudflare:master May 18, 2021
@oliverpool oliverpool deleted the patch-1 branch May 18, 2021 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check HTTP Method after mapRequestToAsset

3 participants