cloudflare / template-registry

A simple API via a Worker that serves all the template content
https://developers.cloudflare.com/workers/templates
Apache License 2.0
62 stars 37 forks source link

Update cache_api.js to use Header.set instead of Header.append #44

Open auburnsummer opened 4 years ago

auburnsummer commented 4 years ago

Hi,

I was having some issues with the Cache API not working as expected. I found that if the response already had a Cache-Control header, I needed to set instead of append. According to the documentation for set, set creates the header if it doesn't exist. I think it should be safe to change the append to set in the template.