mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-07-13 07:01:02 -05:00
Merge pull request #26 from MikeIsAStar/do-not-panic-when-invalid-xml-is-received
SAKE: Don't panic when invalid XML is received
This commit is contained in:
commit
afe7a42bfc
|
|
@ -123,13 +123,12 @@ func handleStorageRequest(moduleName string, w http.ResponseWriter, r *http.Requ
|
|||
panic(err)
|
||||
}
|
||||
|
||||
// logging.Notice(moduleName, string(body))
|
||||
|
||||
// Parse the SOAP request XML
|
||||
soap := StorageRequestEnvelope{}
|
||||
err = xml.Unmarshal(body, &soap)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
logging.Error(moduleName, "Received invalid XML")
|
||||
return
|
||||
}
|
||||
|
||||
response := StorageResponseEnvelope{
|
||||
|
|
@ -172,7 +171,6 @@ func handleStorageRequest(moduleName string, w http.ResponseWriter, r *http.Requ
|
|||
}
|
||||
|
||||
payload := append([]byte(`<?xml version="1.0" encoding="utf-8"?>`), out...)
|
||||
// logging.Notice(moduleName, string(payload))
|
||||
|
||||
w.Header().Set("Content-Type", "text/xml")
|
||||
w.Header().Set("Content-Length", strconv.Itoa(len(payload)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user