mirror of https://github.com/OpenVidu/openvidu.git
Extended success responses on 'LocalRecorder.upload...()' methods (2XX instead of 200)
parent
5e756e9a97
commit
3831138de3
|
@ -207,8 +207,9 @@ export class LocalRecorder {
|
||||||
http.open("POST", endpoint, true);
|
http.open("POST", endpoint, true);
|
||||||
http.onreadystatechange = () => {
|
http.onreadystatechange = () => {
|
||||||
if (http.readyState === 4) {
|
if (http.readyState === 4) {
|
||||||
if (http.status === 200) {
|
if (http.status.toString().charAt(0) === '2') {
|
||||||
resolve("File uploaded");
|
// Success response from server (HTTP status standard: 2XX is success)
|
||||||
|
resolve(http.responseText);
|
||||||
} else {
|
} else {
|
||||||
reject(Error("Upload error: " + http.status));
|
reject(Error("Upload error: " + http.status));
|
||||||
}
|
}
|
||||||
|
@ -233,8 +234,9 @@ export class LocalRecorder {
|
||||||
|
|
||||||
http.onreadystatechange = () => {
|
http.onreadystatechange = () => {
|
||||||
if (http.readyState === 4) {
|
if (http.readyState === 4) {
|
||||||
if (http.status === 200) {
|
if (http.status.toString().charAt(0) === '2') {
|
||||||
resolve("File uploaded");
|
// Success response from server (HTTP status standard: 2XX is success)
|
||||||
|
resolve(http.responseText);
|
||||||
} else {
|
} else {
|
||||||
reject(Error("Upload error: " + http.status));
|
reject(Error("Upload error: " + http.status));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue