Closed Rich-Harris closed 2 years ago
The docs model is saving and serving text instead of JSON: https://github.com/sveltejs/api.svelte.dev/blob/master/src/models/docs.ts#L10
So when worktop sees & sends the docs
value it's already a string & worktop skips the auto-cast to JSON and doesn't auto-apply the header: https://github.com/sveltejs/api.svelte.dev/blob/master/src/routes/docs.ts#L22
This was probably done for performance optimization and/or a result of data migration. If not I'd recommend the KV store deal with JSON values. Otherwise send a custom headers object to last res.send method
https://api.svelte.dev/docs/svelte/tutorial/introduction-basics. Easy enough to add in https://github.com/sveltejs/api.svelte.dev/blob/master/src/routes/docs.ts but maybe there's a neater/more comprehensive solution