-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Accessor functions for response header #89
Comments
I used to be skeptical of the need for those functions because I didn't think end users would use Lack request objects directly; however, they do. |
So then which Standard response fields should we include? All which are permanent and not obsolete? That would be a lot though. |
Response headers that web applications would use are limited. |
Yeah these are the basic ones that most use. However some people might want to use more exotic standard or Common non-standard fields. Here are some candidates from HTTP Security Response Headers Cheat Sheet
Is the prefix "response-" needed, or not? (content-type response) Should we also introduce set-* functions so one less parentheses is necessary: (set-response-content-type response "application/json")
;; vs:
(setf (response-content-type response) "application/json") Also a general-purpose functions to add/update multiple Headers (set-headers response
:content-type "application/json"
:server "default") |
Yeah, I never used them, but it seems a good list to be added.
Since other functions in Lack.Response, it's better to have a prefix of
I don't really like it, and maybe there's not much benefits.
It looks neat. |
It might be convenient to have simple (syntactic-sugar)
functions for accessing and setf'ing single response header.
A generic one would be:
Alternatively, or on top of that we could introduce access/setf
functions for frequently used header (e.g. content-type, etc.):
Do you like the idea, or unnecessary code bloat @fukamachi ?
The text was updated successfully, but these errors were encountered: