Skip to content

Commit 4ad2a96

Browse files
committed
Merge branch 'master' of github.com:msoap/shell2http
2 parents 9518ba3 + 94e50c0 commit 4ad2a96

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

shell2http.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ func getShellHandler(appConfig Config, shell string, params []string, cacheTTL r
139139
return func(rw http.ResponseWriter, req *http.Request) {
140140
shellOut, exitCode, err := execShellCommand(appConfig, shell, params, req, cacheTTL)
141141
if err != nil {
142-
log.Println("exec error: ", err)
142+
log.Println(string(shellOut), "\nexec error: ", err)
143143
}
144144

145145
rw.Header().Set("X-Shell2http-Exit-Code", strconv.Itoa(exitCode))
146146

147147
if err != nil && !appConfig.showErrors {
148-
responseWrite(rw, "exec error: "+err.Error())
148+
responseWrite(rw, string(shellOut)+"\nexec error: "+err.Error())
149149
} else {
150150
outText := string(shellOut)
151151
if appConfig.setCGI {

shell2http_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func Test_main(t *testing.T) {
227227
)
228228

229229
testHTTP(t, "GET", "http://localhost:"+port+"/error", "",
230-
func(res string) bool { return strings.HasPrefix(res, "exec error:") },
230+
func(res string) bool { return strings.Contains(res, "exec error:") },
231231
"5. error",
232232
)
233233

0 commit comments

Comments
 (0)