Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #98 from UlfBj/master
Browse files Browse the repository at this point in the history
Bug fixes.
  • Loading branch information
UlfBj authored Jan 8, 2024
2 parents d5da421 + 383c82d commit bd92da7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion client/client-1.0/Javascript/atclient.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ <h2>AT client example</h2>
function sendPost() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
if (this.readyState == 4 && this.status == 201) {
postOutput.innerHTML += "Server: " + this.responseText + "\n";
}
};
var params = postValue.value;
console.log("params: " + params);
console.log("postpath: " + postPath.value);

xhttp.open("POST", "http://" + hostIP + ":8600/" + postPath.value, true);
xhttp.send(params);
postPath.value = "";
Expand Down
4 changes: 2 additions & 2 deletions server/vissv2server/atServer/atServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func makeAtServerHandler(atsChannel chan string) func(http.ResponseWriter, *http
http.Error(w, "400 bad input.", 400)
} else {
w.Header().Set("Access-Control-Allow-Origin", "*")
// w.Header().Set("Content-Type", "application/json")
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(201) // USE 201 when responding to succesful POST requests
w.Write([]byte(response))
}
Expand Down Expand Up @@ -1365,7 +1365,7 @@ func AtServerInit(viss2Chan chan string, viss2CancelChan chan string, vssRootRef
gatingId := purgeLists()
if gatingId != "" {
viss2CancelChan <- gatingId
} else
}
}
}
}

0 comments on commit bd92da7

Please sign in to comment.