Revert "add missing corp/cache-control headers to authenticated media"
This reverts commit 9d25b0d5c27dbcc62a70fbaacb80632bf6bc9ebc.
This commit is contained in:
parent
3174097e35
commit
959048c0c4
@ -9,14 +9,12 @@ pub mod v1 {
|
|||||||
|
|
||||||
use std::{borrow::Cow, time::Duration};
|
use std::{borrow::Cow, time::Duration};
|
||||||
|
|
||||||
use http::header::{CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_TYPE};
|
use http::header::{CONTENT_DISPOSITION, CONTENT_TYPE};
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
metadata, IdParseError, MxcUri, OwnedServerName,
|
metadata, IdParseError, MxcUri, OwnedServerName,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::http_headers::CROSS_ORIGIN_RESOURCE_POLICY;
|
|
||||||
|
|
||||||
const METADATA: Metadata = metadata! {
|
const METADATA: Metadata = metadata! {
|
||||||
method: GET,
|
method: GET,
|
||||||
rate_limited: true,
|
rate_limited: true,
|
||||||
@ -70,22 +68,6 @@ pub mod v1 {
|
|||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#Syntax
|
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#Syntax
|
||||||
#[ruma_api(header = CONTENT_DISPOSITION)]
|
#[ruma_api(header = CONTENT_DISPOSITION)]
|
||||||
pub content_disposition: Option<Cow<'static, str>>,
|
pub content_disposition: Option<Cow<'static, str>>,
|
||||||
|
|
||||||
/// The value of the `Cross-Origin-Resource-Policy` HTTP header.
|
|
||||||
///
|
|
||||||
/// See [MDN] for the syntax.
|
|
||||||
///
|
|
||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
|
||||||
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
|
||||||
pub cross_origin_resource_policy: Option<Cow<'static, str>>,
|
|
||||||
|
|
||||||
/// The value of the `Cache-Control` HTTP header.
|
|
||||||
///
|
|
||||||
/// See [MDN] for the syntax.
|
|
||||||
///
|
|
||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#syntax
|
|
||||||
#[ruma_api(header = CACHE_CONTROL)]
|
|
||||||
pub cache_control: Option<Cow<'static, str>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -105,13 +87,7 @@ pub mod v1 {
|
|||||||
impl Response {
|
impl Response {
|
||||||
/// Creates a new `Response` with the given file contents.
|
/// Creates a new `Response` with the given file contents.
|
||||||
pub fn new(file: Vec<u8>) -> Self {
|
pub fn new(file: Vec<u8>) -> Self {
|
||||||
Self {
|
Self { file, content_type: None, content_disposition: None }
|
||||||
file,
|
|
||||||
content_type: None,
|
|
||||||
content_disposition: None,
|
|
||||||
cross_origin_resource_policy: None,
|
|
||||||
cache_control: None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,14 +9,12 @@ pub mod v1 {
|
|||||||
|
|
||||||
use std::{borrow::Cow, time::Duration};
|
use std::{borrow::Cow, time::Duration};
|
||||||
|
|
||||||
use http::header::{CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_TYPE};
|
use http::header::{CONTENT_DISPOSITION, CONTENT_TYPE};
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
metadata, IdParseError, MxcUri, OwnedServerName,
|
metadata, IdParseError, MxcUri, OwnedServerName,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::http_headers::CROSS_ORIGIN_RESOURCE_POLICY;
|
|
||||||
|
|
||||||
const METADATA: Metadata = metadata! {
|
const METADATA: Metadata = metadata! {
|
||||||
method: GET,
|
method: GET,
|
||||||
rate_limited: true,
|
rate_limited: true,
|
||||||
@ -74,22 +72,6 @@ pub mod v1 {
|
|||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#Syntax
|
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#Syntax
|
||||||
#[ruma_api(header = CONTENT_DISPOSITION)]
|
#[ruma_api(header = CONTENT_DISPOSITION)]
|
||||||
pub content_disposition: Option<Cow<'static, str>>,
|
pub content_disposition: Option<Cow<'static, str>>,
|
||||||
|
|
||||||
/// The value of the `Cross-Origin-Resource-Policy` HTTP header.
|
|
||||||
///
|
|
||||||
/// See [MDN] for the syntax.
|
|
||||||
///
|
|
||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
|
||||||
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
|
||||||
pub cross_origin_resource_policy: Option<Cow<'static, str>>,
|
|
||||||
|
|
||||||
/// The value of the `Cache-Control` HTTP header.
|
|
||||||
///
|
|
||||||
/// See [MDN] for the syntax.
|
|
||||||
///
|
|
||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#syntax
|
|
||||||
#[ruma_api(header = CACHE_CONTROL)]
|
|
||||||
pub cache_control: Option<Cow<'static, str>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -114,13 +96,7 @@ pub mod v1 {
|
|||||||
impl Response {
|
impl Response {
|
||||||
/// Creates a new `Response` with the given file.
|
/// Creates a new `Response` with the given file.
|
||||||
pub fn new(file: Vec<u8>) -> Self {
|
pub fn new(file: Vec<u8>) -> Self {
|
||||||
Self {
|
Self { file, content_type: None, content_disposition: None }
|
||||||
file,
|
|
||||||
content_type: None,
|
|
||||||
content_disposition: None,
|
|
||||||
cross_origin_resource_policy: None,
|
|
||||||
cache_control: None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,16 +9,14 @@ pub mod v1 {
|
|||||||
|
|
||||||
use std::{borrow::Cow, time::Duration};
|
use std::{borrow::Cow, time::Duration};
|
||||||
|
|
||||||
use http::header::{CACHE_CONTROL, CONTENT_TYPE};
|
use http::header::CONTENT_TYPE;
|
||||||
use js_int::UInt;
|
use js_int::UInt;
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
metadata, IdParseError, MxcUri, OwnedServerName,
|
metadata, IdParseError, MxcUri, OwnedServerName,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::media::get_content_thumbnail::v3::Method;
|
||||||
http_headers::CROSS_ORIGIN_RESOURCE_POLICY, media::get_content_thumbnail::v3::Method,
|
|
||||||
};
|
|
||||||
|
|
||||||
const METADATA: Metadata = metadata! {
|
const METADATA: Metadata = metadata! {
|
||||||
method: GET,
|
method: GET,
|
||||||
@ -90,22 +88,6 @@ pub mod v1 {
|
|||||||
/// The content type of the thumbnail.
|
/// The content type of the thumbnail.
|
||||||
#[ruma_api(header = CONTENT_TYPE)]
|
#[ruma_api(header = CONTENT_TYPE)]
|
||||||
pub content_type: Option<Cow<'static, str>>,
|
pub content_type: Option<Cow<'static, str>>,
|
||||||
|
|
||||||
/// The value of the `Cross-Origin-Resource-Policy` HTTP header.
|
|
||||||
///
|
|
||||||
/// See [MDN] for the syntax.
|
|
||||||
///
|
|
||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
|
||||||
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
|
||||||
pub cross_origin_resource_policy: Option<Cow<'static, str>>,
|
|
||||||
|
|
||||||
/// The value of the `Cache-Control` HTTP header.
|
|
||||||
///
|
|
||||||
/// See [MDN] for the syntax.
|
|
||||||
///
|
|
||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#syntax
|
|
||||||
#[ruma_api(header = CACHE_CONTROL)]
|
|
||||||
pub cache_control: Option<Cow<'static, str>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -140,12 +122,7 @@ pub mod v1 {
|
|||||||
impl Response {
|
impl Response {
|
||||||
/// Creates a new `Response` with the given thumbnail.
|
/// Creates a new `Response` with the given thumbnail.
|
||||||
pub fn new(file: Vec<u8>) -> Self {
|
pub fn new(file: Vec<u8>) -> Self {
|
||||||
Self {
|
Self { file, content_type: None }
|
||||||
file,
|
|
||||||
content_type: None,
|
|
||||||
cross_origin_resource_policy: None,
|
|
||||||
cache_control: None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user