Add a few dummy endpoints to make riot progress further

This commit is contained in:
timokoesters 2020-04-07 13:21:05 +02:00
parent ddcd423e6f
commit 215a31c513
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
2 changed files with 63 additions and 12 deletions

View file

@ -63,7 +63,7 @@ where
let token = match request
.headers()
.get_one("Authorization")
.map(|s| s.to_owned())
.map(|s| s[7..].to_owned()) // Split off "Bearer "
.or_else(|| request.get_query_value("access_token").and_then(|r| r.ok()))
{
// TODO: M_MISSING_TOKEN
@ -95,7 +95,7 @@ where
let http_request = http_request.body(body.clone()).unwrap();
log::info!("{:?}", http_request);
match T::Incoming::try_from(http_request) {
match T::Incoming::try_from(dbg!(http_request)) {
Ok(t) => Success(Ruma {
body: t,
user_id,
@ -151,6 +151,9 @@ where
.sized_body(Cursor::new(http_response.body().clone()))
.await;
let status = http_response.status();
response.raw_status(status.into(), "");
for header in http_response.headers() {
response
.raw_header(header.0.to_string(), header.1.to_str().unwrap().to_owned());