Issue : CookieEncoder quoted String

Trustin Lee trustin at gmail.com
Thu Oct 20 19:25:56 EDT 2011


In RFC 2965:

value = token | quoted-string

and token is, informally, a sequence of non-special, non-white space characters.

In Section 2.2 of RFC 2616:

 token = 1*<any CHAR except CTLs or separators> separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT

So, if value contains any of the separator characters, it should be quoted.




-- 
Trustin Lee
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Wednesday, October 19, 2011 at 1:05 AM, ekefly wrote:

> I looked into cookieencoder's src code:
> 
> 
> /private static void add(StringBuilder sb, String name, String val) {
>  if (val == null) {
>  addQuoted(sb, name, "");
>  return;
>  }
> 
>  for (int i = 0; i < val.length(); i ++) {
>  char c = val.charAt(i);
>  switch (c) {
>  case '\t': case ' ': case '"': case '(': case ')': case ',':
>  case '/': case ':': case ';': case '<': case '=': case '>':
>  case '?': case '@': case '[': case '\\': case ']':
>  case '{': case '}':
>  addQuoted(sb, name, val);
>  return;
>  }
>  }
> 
>  addUnquoted(sb, name, val);
>  }/
> 
> Could anybody know which specification need encoder do this? I checked rfc
> 2109 and 2965, do not find any part describe this. Or i may ignore
> something. 
> 
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Issue-CookieEncoder-quoted-String-tp6907623p6907651.html
> Sent from the Netty User Group mailing list archive at Nabble.com (http://Nabble.com).
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org (mailto:netty-users at lists.jboss.org)
> https://lists.jboss.org/mailman/listinfo/netty-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20111020/a892c453/attachment.html 


More information about the netty-users mailing list