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

Constraint_Error on tab character #385

Open
Rombobeorn opened this issue Sep 23, 2024 · 0 comments
Open

Constraint_Error on tab character #385

Rombobeorn opened this issue Sep 23, 2024 · 0 comments
Assignees
Labels

Comments

@Rombobeorn
Copy link

AWS.Headers.Read_G.Parse_Header_Line tries to trim whitespace off header field values by using Ada.Strings.Fixed.Trim. That removes only spaces. Any tab characters, and any space characters hidden behind tab characters, are left included in the value.

RFC 9112 section 5.1 says:

OWS occurring before the first non-whitespace octet of the field line value, or after the last non-whitespace octet of the field line value, is excluded by parsers when extracting the field line value from a field line.

OWS is defined in RFC 9110 section 5.6.3 as any number of space and/or tab characters:

  OWS            = *( SP / HTAB )
                 ; optional whitespace

If a request is sent with AWS.Client.Get and the response includes a tab in the length field, like

Content-Length:<tab>123

or

Content-Length: 123<tab>

it results in a Constraint_Error with a message like «bad input for 'Value: " 123"».

To be permissive in what it accepts, AWS needs to trim both spaces and tabs from field values.

@TurboGit TurboGit self-assigned this Nov 25, 2024
@TurboGit TurboGit added the bug label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants