Skip to content
This repository was archived by the owner on Jun 2, 2022. It is now read-only.
This repository was archived by the owner on Jun 2, 2022. It is now read-only.

White space character in http cookies causes a crash #82

@bjuraszewski

Description

@bjuraszewski

I get the following error when trying to access cookies of HttpClientResponse of HttpClient.getUrl request:

Unhandled exception:
FormatException: Invalid character in cookie value, code unit: '32' (at character 11)
20.08.2020 23:48:26
          ^

#0      _Cookie._validateValue  (dart:_http/http_headers.dart:1100:9)
#1      _Cookie._parseSetCookieValue  (dart:_http/http_headers.dart:1018:14)

#2      new _Cookie.fromSetCookieValue  (dart:_http/http_headers.dart:943:5)
#3      new Cookie.fromSetCookieValue (dart:_http:1057:16)
#4      _HttpClientResponse.cookies  (dart:_http/http_impl.dart:339:25)
#5      main 
main.dart:51

This is a result of following code snippet:

request = await http.getUrl(redirection);
request.followRedirects = false;

response = await request.close();
print(response.cookies);

List of headers associated with the response:

x-powered-by: ASP.NET
location: https://sis.eti.pg.edu.pl/
set-cookie: StatCook=20.08.2020 23:50:08; path=/  
set-cookie: casauth=---removed_for_security_reasons---; path=/; HttpOnly
date: Thu, 20 Aug 2020 21:50:08 GMT
content-length: 143
content-type: text/html; charset=utf-8
server: Microsoft-IIS/10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions