hyperium / http

Rust HTTP types
Apache License 2.0
1.16k stars 291 forks source link

feat: support conversions from `url::Url` #375

Closed davidbarsky closed 1 year ago

davidbarsky commented 4 years ago

Motivation

davidbarsky commented 4 years ago

(cc: @seanmonstar.)

seanmonstar commented 4 years ago

Relevant discussion about why this hasn't been implemented in the past: https://github.com/hyperium/http/issues/73

davidbarsky commented 4 years ago

@seanmonstar Thanks for the background context. There are a few circumstances—namely, the AWS use-case—where I am constructing full URLs, not just URI fragments that compose into a target of an HTTP request. I think this PR implements the relatively conservative conversions as outlined in Carl's comment: https://github.com/hyperium/http/issues/73#issuecomment-319422772.

davidbarsky commented 4 years ago

Not sure if any decision have been made on this PR but I think something along the lines of https://github.com/hyperium/http/pull/276 would address some of the goals of this PR. I'd be happy to revive #276.

(cc: @carllerche.)