mirror of https://github.com/perkeep/perkeep.git
Merge "httputil: allow full error serving when with devcam"
This commit is contained in:
commit
5ace3bea0f
|
@ -27,6 +27,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -63,7 +64,7 @@ func RequestEntityTooLargeError(conn http.ResponseWriter) {
|
||||||
|
|
||||||
func ServeError(conn http.ResponseWriter, req *http.Request, err error) {
|
func ServeError(conn http.ResponseWriter, req *http.Request, err error) {
|
||||||
conn.WriteHeader(http.StatusInternalServerError)
|
conn.WriteHeader(http.StatusInternalServerError)
|
||||||
if IsLocalhost(req) {
|
if IsLocalhost(req) || os.Getenv("CAMLI_DEV_CAMLI_ROOT") != "" {
|
||||||
fmt.Fprintf(conn, "Server error: %s\n", err)
|
fmt.Fprintf(conn, "Server error: %s\n", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue