Code Monkey home page Code Monkey logo

Comments (4)

SergioBenitez avatar SergioBenitez commented on May 24, 2024

Looks like this was resolved downstream.

from cookie-rs.

bnoordhuis avatar bnoordhuis commented on May 24, 2024

Can I request this be revisited? I ran into this as well.

from cookie-rs.

SergioBenitez avatar SergioBenitez commented on May 24, 2024

@bnoordhuis According to RFC #6265 and 2616, non-ASCII characters are not allowed in cookie name or values:

 cookie-name       = token
 cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
 cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
                       ; US-ASCII characters excluding CTLs,
                       ; whitespace DQUOTE, comma, semicolon,
                       ; and backslash
 token             = 1*<any CHAR except CTLs or separators>
 CHAR              = <any US-ASCII character (octets 0 - 127)>

Chrome and Opera seem to allow UTF-8, and Firefox seems to sort-of allow UTF-8, but I cannot find any indication of any browser supporting non-UTF-8, and certainly not arbitrary bytes. What is your use-case?

from cookie-rs.

bnoordhuis avatar bnoordhuis commented on May 24, 2024

I observed that in the wild some clients and servers send latin-1. I'm aware of the spec but rejecting non-compliant HTTP requests and responses wasn't an option for me. I solved it by writing a custom cookie parser.

from cookie-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.