|
|
|
@ -55,11 +55,13 @@ func UpdateResponse(r *http.Response) error {
|
|
|
|
|
|
|
|
|
|
log.WithFields(
|
|
|
|
|
log.Fields{
|
|
|
|
|
"r.Header": r.Header,
|
|
|
|
|
"statusCode": statusCode,
|
|
|
|
|
"contentType": contentType,
|
|
|
|
|
"contentEncoding": contentEncoding,
|
|
|
|
|
"location": location,
|
|
|
|
|
"r.Header": r.Header,
|
|
|
|
|
"r.Request.URL.Path": r.Request.URL.Path,
|
|
|
|
|
"proxyURL": proxyURL,
|
|
|
|
|
"statusCode": statusCode,
|
|
|
|
|
"contentType": contentType,
|
|
|
|
|
"contentEncoding": contentEncoding,
|
|
|
|
|
"location": location,
|
|
|
|
|
},
|
|
|
|
|
).Debug()
|
|
|
|
|
|
|
|
|
@ -99,6 +101,12 @@ func UpdateResponse(r *http.Response) error {
|
|
|
|
|
updatedStringbody = strings.Replace(stringBody, "action=\"/\"", "action=\"/pastebin/\"", 1)
|
|
|
|
|
} else if strings.HasPrefix(proxyURL, "http://cinny") {
|
|
|
|
|
updatedStringbody = strings.Replace(stringBody, `<body id="appBody">`, `<body id="appBody">`+updatedMenu, 1)
|
|
|
|
|
} else if strings.HasPrefix(proxyURL, "http://nginx") {
|
|
|
|
|
if r.Request.URL.Path == "/" {
|
|
|
|
|
updatedStringbody = strings.Replace(stringBody, "<body>", "<body>"+updatedMenu, 1)
|
|
|
|
|
} else {
|
|
|
|
|
updatedStringbody = stringBody
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
updatedStringbody = strings.Replace(stringBody, "<body>", "<body>"+updatedMenu, 1)
|
|
|
|
|
}
|
|
|
|
|