Skip to content

Commit

Permalink
Don't bail on GET to upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerX committed Dec 9, 2024
1 parent f6eaff6 commit b80a3fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions backend/cmd/server/upload.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package main

import (
"github.com/bcc-code/mediabank-bridge/log"
"io"
"net/http"
"os"
"path/filepath"
"strconv"

"github.com/bcc-code/mediabank-bridge/log"

ingestworkflows "github.com/bcc-code/bcc-media-flows/workflows/ingest"

"github.com/google/uuid"
Expand Down Expand Up @@ -53,7 +54,9 @@ func (u uploadHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// End permission check

if r.Method != http.MethodPost {
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
// http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
log.L.Debug().Str("invalid method", r.Method)
http.Error(w, "", http.StatusOK)
return
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/components/FileUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const uploadFile = () => {
const xhr = new XMLHttpRequest();
let startedAt: number;
xhr.open("POST", props.endpoint, true);
xhr.open("post", props.endpoint, true);
xhr.onloadstart = function () {
startedAt = Date.now();
};
Expand Down

0 comments on commit b80a3fc

Please sign in to comment.