-
Notifications
You must be signed in to change notification settings - Fork 9
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
Avoid using res #4
Comments
Um, that is what the |
Your example above is done with the module today, but maybe you didn't even read my readme, which is very hurtful, especially if you are writing a blog post to bash a module saying it should have a feature it already does and even documents on the readme that is smaller than your blog post :( const value = res.getHeader('Vary');
const newValue = vary.append(value, 'Origin')
res.setHeader('Vary', newValue); |
Closing as invalid, because this feature is already provided. |
You are perfectly right and i'm really sorry to have disturb you with that stinky issue. I took time to read the full readme prior to the append addition and i stayed on my first opinion. Hope you won't mind me, i'll remove that part of my blog post before publishing it. |
FWIW, I agree that the modules should not require |
I'll lurk more, i promise ;). It is a great thing you're open to such additions, i will PR if i see that purely functionnal features can be added in the JS HTTP projects. |
Yea. So these modules were originally built-ins to the like of Connect/Express, but those projects were chopped up to individual modules so that other people would re-use them. Of course, that means that their interfaces currently may prefer the usage of Express/Connect, but I have at least worked to ensure they can always be used with only the base Node.js objects. I personally don't have too much a need for the pure functions in my day-to-day work, so of course an not greatly adding them myself, but definitely don't mind adding any that are missing if there is a desire :) It's always tricky to create a module (or API) that you would never use, because you could have created an unusable API and you'd never know it ;) so being able to add it where there will be a live use-case somewhere is the best case scenario to make it a useful API. |
Since i emitted a lil critic of this module in a blog post i think i have to submit an issue for the problem i raise in it to be totally fair.
I think this module should not assume its users to have any
res
object and stay the closest possible to the problem it solves by letting users to define were they want to pick/set the vary header value:In short, it should be more functionnal ;). I know it is a breaking change and you probably do not plan to do so but just dropping the idea.
For ref.:
https://github.com/nfroidure/blog/blob/4b6bfdccea8ad404dcc2bc116fa609f220388a5c/contents/pages/en/blog/http_rest_apis_with_nodejs.html#L346-L360
Till a draft
The text was updated successfully, but these errors were encountered: