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
How to Set header in Response #89
Comments
Hi. This could be solved as part of #130 by adding As for current situation, your can make it work similarly to custom status by a few changes. Then you have to update template for your library, so in case of express this is the place to set headers: https://github.com/lukeautry/tsoa/blob/master/src/routeGeneration/templates/express.ts#L91 (see https://github.com/lukeautry/tsoa#override-route-template on how to override template). Also while you're at it, there is a bug which causes status to be read before promise resolves https://github.com/lukeautry/tsoa/blob/master/src/routeGeneration/templates/express.ts#L69 (see #94). Feel free to contribute in discussion here: #130 for improving controller to support your use cases in simple way. |
- update route schema and update type - change swagger enum inline type to enum definitions - add new rule for tslint - fix set status not work lukeautry#94 - support custom response header lukeautry#89
- update route schema and update type - change swagger enum inline type to enum definitions - add new rule for tslint - fix set status not work lukeautry#94 - support custom response header lukeautry#89
- Support Query array type - Support custom response header (#89) - Support tsoa config yaml format (#133) - Support generate swagger yaml format - Support string, number and boolan UnionType (#5) - Support AnyKeyword (#114) - update route schema and update type - Change swagger enum inline type to enum definitions - Add new rule for tslint - Fix set status not work #94 - Fix validate - Set query array collectionFormat, default to multi - Create file for Circle CI
- Support Query array type - Support custom response header (#89) - Support tsoa config yaml format (#133) - Support generate swagger yaml format - Support string, number and boolan UnionType (#5) - Support AnyKeyword (#114) - update route schema and update type - Change swagger enum inline type to enum definitions - Add new rule for tslint - Fix set status not work #94 - Fix validate - Set query array collectionFormat, default to multi - Create file for Circle CI
Fix: 0534cbd example:
|
Hi Everyone,
First I would thank Luke Autry and everyone who is contributing to this wonderful framework. It is exactly what I was looking for after trying so many different projects. Can anyone tell me the best way to go about accessing the Response Header in the Controller. I have an Authorization Controller, and I would like to place a token in the header on a successful response.
typically I would have done
res.set(field, [value]) or res.header(field, [value])
So in side of controller method login, I am not sure where to even begin...
Thanks In Advance for any help
The text was updated successfully, but these errors were encountered: