client-api: Add cache-control header to media responses.
This commit is contained in:
parent
31851540e9
commit
eb970d044d
@ -9,7 +9,7 @@ pub mod v3 {
|
|||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use http::header::{CONTENT_DISPOSITION, CONTENT_TYPE};
|
use http::header::{CACHE_CONTROL, 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,
|
||||||
@ -96,6 +96,14 @@ pub mod v3 {
|
|||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
||||||
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
||||||
pub cross_origin_resource_policy: Option<String>,
|
pub cross_origin_resource_policy: Option<String>,
|
||||||
|
|
||||||
|
/// 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<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -128,6 +136,7 @@ pub mod v3 {
|
|||||||
content_type: None,
|
content_type: None,
|
||||||
content_disposition: None,
|
content_disposition: None,
|
||||||
cross_origin_resource_policy: Some("cross-origin".to_owned()),
|
cross_origin_resource_policy: Some("cross-origin".to_owned()),
|
||||||
|
cache_control: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ pub mod v3 {
|
|||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use http::header::{CONTENT_DISPOSITION, CONTENT_TYPE};
|
use http::header::{CACHE_CONTROL, 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,
|
||||||
@ -100,6 +100,14 @@ pub mod v3 {
|
|||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
||||||
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
||||||
pub cross_origin_resource_policy: Option<String>,
|
pub cross_origin_resource_policy: Option<String>,
|
||||||
|
|
||||||
|
/// 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<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -133,6 +141,7 @@ pub mod v3 {
|
|||||||
content_type: None,
|
content_type: None,
|
||||||
content_disposition: None,
|
content_disposition: None,
|
||||||
cross_origin_resource_policy: Some("cross-origin".to_owned()),
|
cross_origin_resource_policy: Some("cross-origin".to_owned()),
|
||||||
|
cache_control: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ pub mod v3 {
|
|||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use http::header::CONTENT_TYPE;
|
use http::header::{CACHE_CONTROL, CONTENT_TYPE};
|
||||||
use js_int::UInt;
|
use js_int::UInt;
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
@ -107,6 +107,14 @@ pub mod v3 {
|
|||||||
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
|
||||||
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
|
||||||
pub cross_origin_resource_policy: Option<String>,
|
pub cross_origin_resource_policy: Option<String>,
|
||||||
|
|
||||||
|
/// 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<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
@ -148,6 +156,7 @@ pub mod v3 {
|
|||||||
file,
|
file,
|
||||||
content_type: None,
|
content_type: None,
|
||||||
cross_origin_resource_policy: Some("cross-origin".to_owned()),
|
cross_origin_resource_policy: Some("cross-origin".to_owned()),
|
||||||
|
cache_control: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user