falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.51k stars 937 forks source link

Provide a way of using Response header functions from HttpStatus and HttpError #1752

Open CaselIT opened 4 years ago

CaselIT commented 4 years ago

Response has a series of utility methods for setting complex headers, like Set-Cookie or Link.

It would be nice to have a similar ability also in the HttpStatus and in the HttpError.

While ideally the interface could be duplicated/shared in a common superclass, I think that most of the benefits could be achieved by making the _wsgi_headers and _asgi_headers public and setting the headers of the HttpStatus/HttpError to that value. https://github.com/falconry/falcon/blob/113eea113844058816ed745d8dc9cb197e75cb95/falcon/response.py#L1049 https://github.com/falconry/falcon/blob/113eea113844058816ed745d8dc9cb197e75cb95/falcon/asgi/response.py#L390

vytas7 commented 3 years ago

Hi @G-Sheridan ! And thanks for sharing. Sounds like a cool AI/DL project to tinker with!

That being said, I'm afraid this issue falls into the remaining gap towards 1.00 AUC, and towards artificial general intelligence.

Despite a really well written description by @CaselIT, it feels like an open ended issue requiring a principal architectural decision on how we want to organize the core parts of the framework. Maybe when these decisions are made and documented, it could be a relatively easy issue, but I still think we could find more fitting stuff to onboard newcomers. We actually do happen to have 12 issues labeled as such :slightly_smiling_face: