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

White space character in http cookies causes a crash #82

Open
Shadow38PL opened this issue Aug 20, 2020 · 0 comments
Open

White space character in http cookies causes a crash #82

Shadow38PL opened this issue Aug 20, 2020 · 0 comments

Comments

@Shadow38PL
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant