mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-10 12:01:36 +00:00
second attempt at iphone content-range fix
This commit is contained in:
1 parent
898e32db05
commit
0281e206db
2 files changed
+8
-4
No files matched your search
@@ -154,10 +154,11 @@ pub async fn legacy_get_speak(request: HttpRequest,
|
||||
// Content-Type: audio/wav
|
||||
// Content-Disposition:
|
||||
// Content-Length: len()
|
||||
let content_range_value = format!("bytes 0-{}/{}", wav_data.len(), wav_data.len());
|
||||
Ok(HttpResponse::build(StatusCode::OK)
|
||||
.content_type("audio/wav")
|
||||
.set_header(header::CONTENT_DISPOSITION, "attachment; filename = \"generated.wav\"")
|
||||
.set_header(header::CONTENT_RANGE, "bytes */*")
|
||||
.set_header(header::CONTENT_RANGE, content_range_value)
|
||||
.body(wav_data))
|
||||
},
|
||||
}
|
||||
@@ -209,10 +210,11 @@ pub async fn legacy_get_speak(request: HttpRequest,
|
||||
// Content-Type: audio/wav
|
||||
// Content-Disposition:
|
||||
// Content-Length: len()
|
||||
let content_range_value = format!("bytes 0-{}/{}", wav_data.len(), wav_data.len());
|
||||
Ok(HttpResponse::build(StatusCode::OK)
|
||||
.content_type("audio/wav")
|
||||
.set_header(header::CONTENT_DISPOSITION, "attachment; filename = \"generated.wav\"")
|
||||
.set_header(header::CONTENT_RANGE, "bytes */*")
|
||||
.set_header(header::CONTENT_RANGE, content_range_value)
|
||||
.body(wav_data))
|
||||
},
|
||||
ModelPipeline::RawTextTacotronMelgan => unimplemented!(),
|
||||
|
||||
@@ -107,10 +107,11 @@ pub async fn post_speak(request: HttpRequest,
|
||||
Some(wav_data) => {
|
||||
// To make iOS Safari work, you need a Content-Range and Content-Length header:
|
||||
// https://stackoverflow.com/a/17835399
|
||||
let content_range_value = format!("bytes 0-{}/{}", wav_data.len(), wav_data.len());
|
||||
Ok(HttpResponse::build(StatusCode::OK)
|
||||
.content_type("audio/wav")
|
||||
.set_header(header::CONTENT_DISPOSITION, "attachment; filename = \"generated.wav\"")
|
||||
.set_header(header::CONTENT_RANGE, "bytes */*")
|
||||
.set_header(header::CONTENT_RANGE, content_range_value)
|
||||
.body(wav_data))
|
||||
},
|
||||
}
|
||||
@@ -140,10 +141,11 @@ pub async fn post_speak(request: HttpRequest,
|
||||
|
||||
// To make iOS Safari work, you need a Content-Range and Content-Length header:
|
||||
// https://stackoverflow.com/a/17835399
|
||||
let content_range_value = format!("bytes 0-{}/{}", wav_data.len(), wav_data.len());
|
||||
Ok(HttpResponse::build(StatusCode::OK)
|
||||
.content_type("audio/wav")
|
||||
.set_header(header::CONTENT_DISPOSITION, "attachment; filename = \"generated.wav\"")
|
||||
.set_header(header::CONTENT_RANGE, "bytes */*")
|
||||
.set_header(header::CONTENT_RANGE, content_range_value)
|
||||
.body(wav_data))
|
||||
},
|
||||
ModelPipeline::RawTextTacotronMelgan => unimplemented!(),
|
||||
|
||||
Reference in new issue
Block a user