Replace deprecated function
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a911808678
commit
1f7a1978b9
@ -48,7 +48,7 @@ fn proxy_file<T: Service>(
|
|||||||
.from_err()
|
.from_err()
|
||||||
.and_then(move |response| match response.status() {
|
.and_then(move |response| match response.status() {
|
||||||
StatusCode::OK => {
|
StatusCode::OK => {
|
||||||
let mime = mime_guess::guess_mime_type(&*data.file);
|
let mime = mime_guess::from_path(&*data.file).first_or_octet_stream();
|
||||||
Ok(HttpResponse::Ok()
|
Ok(HttpResponse::Ok()
|
||||||
.content_type(mime.to_string().as_str())
|
.content_type(mime.to_string().as_str())
|
||||||
.set(CacheControl(vec![
|
.set(CacheControl(vec![
|
||||||
@ -127,7 +127,7 @@ fn serve_gist(
|
|||||||
.from_err()
|
.from_err()
|
||||||
.and_then(move |response| match response.status() {
|
.and_then(move |response| match response.status() {
|
||||||
StatusCode::OK => {
|
StatusCode::OK => {
|
||||||
let mime = mime_guess::guess_mime_type(&*data.file);
|
let mime = mime_guess::from_path(&*data.file).first_or_octet_stream();
|
||||||
Ok(HttpResponse::Ok()
|
Ok(HttpResponse::Ok()
|
||||||
.content_type(mime.to_string().as_str())
|
.content_type(mime.to_string().as_str())
|
||||||
.set(CacheControl(vec![
|
.set(CacheControl(vec![
|
||||||
|
Loading…
Reference in New Issue
Block a user