Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow tracking ResponseHeaders #4045

Open
ryskajakub opened this issue Dec 1, 2024 · 1 comment
Open

allow tracking ResponseHeaders #4045

ryskajakub opened this issue Dec 1, 2024 · 1 comment
Labels
enhancement New feature or request platform

Comments

@ryskajakub
Copy link
Contributor

What is the problem this feature would solve?

when I want to declare some response headers from endopint, I have no option, how to declare them in API.

What is the feature you are proposing to solve the problem?

allow declaring something like this in API:
.addSuccess({ responseBody: ... , responseHeaders }),

when this declaration is in use, I would return something like this in the handler:

 return Effect.suceed({ responseBody: { a: "b" }, responseHeaders: { "ETag": "deadbeef" } })

What alternatives have you considered?

I have workaround,

  1. use Transform annotation to properly specify response headers in the swagger
  2. use .handleRaw to handle the endpoint, which is not very typesafe and I can basically return any response and the code will still typecheck.
@ryskajakub ryskajakub added the enhancement New feature or request label Dec 1, 2024
@gcanti gcanti added the platform label Dec 5, 2024
@ryanbas21
Copy link

Just commenting that i'm refactoring an older effect-http api, and this seems to be missing (either from the docs or ability to do it other than the work around above).

a .setResponseHeaders method would be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform
Projects
None yet
Development

No branches or pull requests

3 participants