fix cookie value parsing

Cookie value(according to RFC6265) can contain US-ASCII characters
excluding CTLs, whitespace, DQUOTE, comma, semicolon and backslash:

cookie-header = "Cookie:" OWS cookie-string OWS
cookie-string = cookie-pair *( ";" SP cookie-pair )
cookie-pair       = cookie-name "=" cookie-value
cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E

But mochiweb_cookie:parse_cookie() use smaller allowed characters list.
For example, if cookie value is base64 string like MQ==,
then parse_cookie() makes it MQ.

Fix this by using a separate function for value parsing instead of
read_token().
1 file changed
tree: 9acff425e79fee8617d48d6bd7a5fc592f43d981
  1. examples/
  2. include/
  3. scripts/
  4. src/
  5. support/
  6. test/
  7. .editorconfig
  8. .gitignore
  9. .travis.yml
  10. CHANGES.md
  11. LICENSE
  12. Makefile
  13. README.md
  14. rebar
  15. rebar.config
README.md

MochiWeb is an Erlang library for building lightweight HTTP servers.

The latest version of MochiWeb is available at http://github.com/mochi/mochiweb

The mailing list for MochiWeb is at http://groups.google.com/group/mochiweb/

To create a new mochiweb using project: make app PROJECT=project_name

To create a new mochiweb using project in a specific directory: make app PROJECT=project_name PREFIX=$HOME/projects/

MochiWeb is currently tested with Erlang/OTP R15B03 through 21.2.3.

OTP 21.2, 21.2.1, 21.2.2 warning

OTP 21.2 (up to and including 21.2.2) introduced an SSL regression that makes these releases unsafe to use. See ERL-830. This issue was resolved in OTP 21.2.3.