Skip to content

Conversation

EliLichtblau
Copy link

import { Elysia } from 'elysia'
import { node } from '@elysiajs/node'

new Elysia({ adapter: node() })
	.get('/', function*({set}) {
		set.headers["content-type"] = "application/jsonl"
		set.headers["content-disposition"] = 'attachment; filename="export.jsonl"'
		for (let i = 0; i <100; i++) {
			yield JSON.stringify({i})+"\n"
		}
	})
	.listen(3000)

This would ignore the set headers because it isn't defined until the first generator.next() call I think. This fixes that bug and adds some test cases for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant