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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user