[plt-scheme] Can this possibly be right?

From: Todd O'Bryan (toddobryan at gmail.com)
Date: Sun Apr 25 01:11:46 EDT 2010

I've either found a bug in net/cookie-unit or I'm very confused.

#lang scheme
(require web-server/http/cookie)

(make-cookie "name" "value")
(make-cookie "name" "(")
(make-cookie "name" "!")
(make-cookie "name" ")")
(make-cookie "name" ")!")
(make-cookie "name" "(!")
(make-cookie "name" "(!)")
(make-cookie "name" "!)")

The first four cookies above work fine. The last four raise the error:

could not convert the given string to an acceptable RFC 2109 value

I looked through the code, but I can't see any obvious reason why
having an exclamation point and a parenthesis in the same string
should cause an error and I'm pretty sure the RFC doesn't require any
error here. Any insights?

The offending function is to-rfc2109:value.


Posted on the users mailing list.