Skip to content

Conversation

@DmitriyMusatkin
Copy link
Contributor

@DmitriyMusatkin DmitriyMusatkin commented Oct 28, 2022

Issue #, if available:
#393

Description of changes:
URI spec allows for path to be empty.
However, HTTP spec says that paths that are empty should be sent as /.
Our URI parser was recently changed to treat empty path as is to be spec compliant.
This change updates http client to treat empty path as / within http request

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(
sorry for being wishy washy

@TingDaoK
Copy link
Contributor

I think what Mike meant is to revert all the change about handling empty path from set_request_path as well. I also agreed. If people called set_request_path with “”, that’s how it is. So, just change the tests to set path to be "/" when it's empty.

However, I think it will be nice if we can handle it from our end as it’s a requirement from HTTP spec. It's basically everyone wants (No one wants to break the spec with empty path). But, I’d prefer to handle it from encoder. So, for h1, it's h1_encoder.c, and for h2, it's hpack_encoder.c

@DmitriyMusatkin DmitriyMusatkin merged commit e80c70d into main Oct 31, 2022
@DmitriyMusatkin DmitriyMusatkin deleted the empty-path branch October 31, 2022 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants