http-rs / http-rs/http-types

Conversion from http::Request to http_types::Request fails

Open
#137 2 comments 0 reactions 0 assignees View on GitHub
semver-major
Dominant language
Rust
Stars
209
Forks
91
PR merge metrics
No merged PRs in 30d

Description

When converting an `http::Request` from `hyper` to an `http_types::Request` the `url` fails to convert with an error:

```rust
relative URL without a base
```

small example problem showing the failure:

```rust
use std::convert::TryFrom;

fn main() {
let request = http::Request::builder()
.method("GET")
.uri("/")
.header("Host", "localhost")
.body(http_types::Body::empty())
.unwrap();

http_types::Request::try_from(request).unwrap();
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.