You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-11-21 23:00:50 +03:00
Layer to application/x-www-form-urlencoded bodies
This commit is contained in:
@@ -19,7 +19,8 @@ use futures_util::{
|
||||
future::{Either, MapErr},
|
||||
FutureExt, TryFutureExt,
|
||||
};
|
||||
use http::{header::CONTENT_TYPE, HeaderValue, Request};
|
||||
use headers::{ContentType, HeaderMapExt};
|
||||
use http::Request;
|
||||
use http_body::Full;
|
||||
use serde::Serialize;
|
||||
use thiserror::Error;
|
||||
@@ -83,9 +84,7 @@ where
|
||||
fn call(&mut self, request: Request<T>) -> Self::Future {
|
||||
let (mut parts, body) = request.into_parts();
|
||||
|
||||
parts
|
||||
.headers
|
||||
.insert(CONTENT_TYPE, HeaderValue::from_static("application/json"));
|
||||
parts.headers.typed_insert(ContentType::json());
|
||||
|
||||
let body = match serde_json::to_vec(&body) {
|
||||
Ok(body) => Full::new(Bytes::from(body)),
|
||||
|
||||
Reference in New Issue
Block a user