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

Add getHeader() response method #23

Closed
jeremydaly opened this Issue Mar 31, 2018 · 2 comments

Comments

Projects
None yet
1 participant
@jeremydaly
Copy link
Owner

jeremydaly commented Mar 31, 2018

Add a getHeader() method on the RESPONSE object to retrieve all current headers OR a specific header if passed as an argument, e.g res.getHeader('Content-Type').

This should ignore case as well.

@jeremydaly jeremydaly added this to the v0.5 milestone Apr 6, 2018

@jeremydaly

This comment has been minimized.

Copy link
Owner

jeremydaly commented Apr 23, 2018

Had to add a loop to search for case insensitive matches. Might need to eventually rewrite the headers() method to store everything as lowercase.

@jeremydaly

This comment has been minimized.

Copy link
Owner

jeremydaly commented Apr 24, 2018

This was bothering me, so I rewrote headers() to now store keys in all lowercase. This makes the other header methods simpler. I took out the loop for the case matching and added a hasHeader() and removeHeader() method as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment