Skip to content

MessageHeader::splitParameters fails on 'httponly' cookie with 'string too long' exception #3059

@SteveHallNNT

Description

@SteveHallNNT

I am using Poco to connect to a web server that is returning a cookie like so :

ss-id=IE05BOrFAKxkzQ2T7yva; path=/; samesite=strict; httponly

however response.getCookies() fails as splitParameters doesn't handle the "httponly" part of the cookie correctly.

The problem is the end of the function where this call happens :

Poco::trimRightInPlace(pvalue);

but as pvalue is empty it fails. I guess the root cause is in trimRightInPlace() but protecting this call with :

if (!pvalue.empty()) Poco::trimRightInPlace(pvalue);

does the job and allows the cookie string to be parsed.

Can this change be made?

Thanks
Steve

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions