Skip to content
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 ContentLength handler for checking the Content-Length HTTP header… #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

szank
Copy link

@szank szank commented Sep 17, 2015

And update to the newest api of the gomega dependency

@@ -48,6 +48,16 @@ func ContentType(ctypes ...string) http.HandlerFunc {
}
}

// ContentLength generates a handler that writes a 411 Length Required response if the request
// doesn't contain the Content-Length header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a trailing ".", to be consistent with other comments in the file?

@attilaolah
Copy link
Contributor

Thank you very much, this seems like a great addition.

I'll merge this on Monday, sorry for having to wait so long!

@szank
Copy link
Author

szank commented Oct 18, 2015

Hi,
Before merging, please let me update the pull request. I want to add a call to atoi() to actually check that the content of Content-Length is an int.
I will do it on Monday.

@attilaolah
Copy link
Contributor

OK, please ping me when you do the update.

Just remember please to follow the RFC in case you get an error from atoi(). IIRC, the spec says to ignore the header altogether, but don't quote me on that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants