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

HTTP header library #12

Open
jpf91 opened this issue Apr 28, 2012 · 1 comment
Open

HTTP header library #12

jpf91 opened this issue Apr 28, 2012 · 1 comment

Comments

@jpf91
Copy link
Contributor

jpf91 commented Apr 28, 2012

I have some (old) code to parse and format http headers. It uses the ragel (http://www.complang.org/ragel/) parser generator to generate the parsers.

I originally wanted to post this for inclusion into phobos, however Andrei made it pretty clear that he doesn't want code in phobos which depends on external tools. So I currently have no real use for this code, if it's useful for vibe.d I'd be happy to contribute it.

Source code:
https://gist.github.com/2516504#file_http.rl.d

Compilable source code (generated by ragel, compile with deprecated code enabled)
https://gist.github.com/2516504#file_http.d

Documentation:
http://dl.dropbox.com/u/24218791/d/src/http.html
(the interesting part is canParseHeader, isHeader, canFormatHeader, formatHeader, formatHeaderValue, parseHeader, parseHeaderValue)

Some refactoring is probably necessary, but I first want to know if there's some interest in this code.

@s-ludwig
Copy link
Member

Looks useful, I will talk to the others to see whats their take on it and how this could be integrated best into the API.

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

No branches or pull requests

3 participants