1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-05 18:03:21 +08:00

Configure CORS correctly

This commit is contained in:
Marcos Lilljedahl
2017-01-13 20:39:44 -03:00
parent 4616cb1f5d
commit f2fe0e3137
2 changed files with 6 additions and 10 deletions

View File

@@ -22,7 +22,7 @@ func NewSession(rw http.ResponseWriter, req *http.Request) {
//TODO: Return some error code
} else {
// If request is not a form, return sessionId in the body
if req.Header.Get("Content-Type") != "application/x-www-form-urlencoded" {
if req.Header.Get("X-Requested-With") == "XMLHttpRequest" {
rw.Write([]byte(s.Id))
return
}