Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
NS_BINDING_ABORTED error once options request is handled by the server

I have a simple HTTP route that isn't method specific. The OPTIONS request for CORS returns a 200, no problem. I'm expecting the subsequent POST after, but Firefox/Safari is throwing an error with an NS_BINDING_ERROR.

enter image description here

As a result, the actual request is never satisfied. Why would this happen? I'm sending an XMLHTTPRequest from the client like so:

function chunkUploader(chunkForm, startChunk, file) {
  var oReq = new XMLHttpRequest();
  oReq.timeout = 2000

  oReq.open("POST", "http://localhost:8300/upload", true);
  oReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 
  oReq.setRequestHeader('Content-Type', 'multipart/form-data'); 

  oReq.onload = function (oEvent) {
    const updatedStartChunk = startChunk + CHUNK_SIZE;
    if (updatedStartChunk < file.size) {
      fileChunker(file, updatedStartChunk);
      return
    }
  };

  console.log(chunkForm.get("file"))
  oReq.send(chunkForm);
}

Snippet

func uploadHandler(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Access-Control-Allow-Origin", "*")
    w.Header().Set("Access-Control-Allow-Headers", "*")
    w.Header().Set("Access-Control-Allow-Methods", "*")

    if r.Method == "OPTIONS" {
        w.WriteHeader(http.StatusOK)
        return
    }

    if err := r.ParseMultipartForm(0); err != nil {
        fmt.Fprintf(w, "Err parsing form.")
    }

    f, _, err := r.FormFile("file")
    if err != nil {
        fmt.Fprintf(w, "Err parsing file.")
    }
    defer f.Close()
    fmt.Println(f)
.....
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!