gnieto e2eb92b8ed
Prevent panic on requests with invalid URIs
When `try_into_http_request` was used with an invalid base URI the code
was panicking. Acording to `http::request::Builder` documentation,
`headers_mut` returns `None` if the builder contains errors, which was
the case when an invalid URI was provided.

The new version only sets the additional headers in case that there are
no errors on the builder, preventing the panic. The conversion will
return an error when the builder is consumed on `body`.
2021-05-08 18:12:56 +02:00
..

ruma-api

crates.io page docs.rs page license: MIT

ruma-api contains core types used to define the requests and responses for each endpoint in the various Matrix API specifications. These types can be shared by client and server code for all Matrix APIs.