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

No request cookies if cookie name contains a dot #2359

Closed
jens-andre opened this issue May 18, 2020 · 0 comments · Fixed by #2372
Closed

No request cookies if cookie name contains a dot #2359

jens-andre opened this issue May 18, 2020 · 0 comments · Fixed by #2372
Labels
bug Something isn't working
Projects

Comments

@jens-andre
Copy link

jens-andre commented May 18, 2020

If a cookie name contains a dot, request.cookies.all is nil.

Steps to reproduce

import Vapor

func routes(_ app: Application) throws {
    app.get("") { request -> Response in
        let response = Response()
        response.cookies["cookie_one"] = HTTPCookies.Value(string: "Cookie 1")
        response.cookies["cookie.two"] = HTTPCookies.Value(string: "Cookie 2")
        
        for cookie in request.cookies.all {
            print(cookie.value.string)
        }
        
        return response
    }
}

Expected behavior

On the next request it should print:

[ INFO ] GET /
Cookie 1
Cookie 2

Actual behavior

[ INFO ] GET /

Environment

  • Vapor Framework version: 4.5.1
  • Vapor Toolbox version: -
  • OS version: macOS 10.15.4
@tanner0101 tanner0101 added the bug Something isn't working label May 28, 2020
@tanner0101 tanner0101 added this to To Do in Vapor 4 via automation May 28, 2020
Vapor 4 automation moved this from To Do to Done May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Vapor 4
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants