Fix an issue with malformed HTTP headers in token_and_options.

Hello,

The following PR solves the issue #14846.

Please feel free to give me some feedback on the PR, this is my first attempt to contribute. :+1: