Skip to content

Conversation

@gazpachoking
Copy link
Contributor

When using DatastarResponse headers passed in get merged with the default headers, so there was no way to remove headers included in the default you didn't want (e.g. the x-accel-buffering for nginx.) This also allows sending an extra header with all datastar responses. User provided defaults can be set on the DatastarResponse classes with this change.

DatastarResponse.default_headers = {**SSE_HEADERS, "x-my-extra-header": "foo"}

# ...

    return DatastarResponse()  # user's default headers used
    return DatastarResponse(headers={"x-another": "header"})  # Another header merged in with the defaults

@bencroker bencroker merged commit 3ac70d1 into starfederation:develop Jun 10, 2025
1 check passed
@bencroker
Copy link
Collaborator

Merged, thanks!

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.

2 participants