flask-io icon indicating copy to clipboard operation
flask-io copied to clipboard

add specific headers in flask-io response

Open tvallois opened this issue 5 years ago • 1 comments

Hello @viniciuschiele

I'd like to be able to set headers on pre-made flask-io response. I've just added a parameters headers on all of them.

Cheers,

Thibault

tvallois avatar Oct 24 '19 14:10 tvallois

Yeah, that is good to have. As a workaround, you can set the headers after calling io.bad_request e.g:

response = io.bad_request(data)
response.headers.add("content-type", "application/json")
return response

viniciuschiele avatar Oct 31 '19 12:10 viniciuschiele