This commit is contained in:
wighawag 2016-05-10 06:07:50 +01:00
parent ce09f5593d
commit 016d464043
2 changed files with 6 additions and 6 deletions

View file

@ -396,4 +396,4 @@ const AuthorizationHTML = `
</script> </script>
</body> </body>
</html> </html>
` `

View file

@ -25,7 +25,7 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"github.com/ethereum/go-ethereum/embed" "github.com/ethereum/go-ethereum/embed"
"github.com/rs/cors" "github.com/rs/cors"
@ -106,15 +106,15 @@ func (t *httpReadWriteNopCloser) Close() error {
// send the request to the given API provider and sends the response back to the caller. // send the request to the given API provider and sends the response back to the caller.
func newJSONHTTPHandler(srv *Server) http.HandlerFunc { func newJSONHTTPHandler(srv *Server) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/authorization.html"{ if r.URL.Path == "/authorization.html" {
w.Header().Set("Content-Type", "text/html; charset=utf-8") w.Header().Set("Content-Type", "text/html; charset=utf-8")
if _, err := w.Write([]byte(embed.AuthorizationHTML)); err != nil { if _, err := w.Write([]byte(embed.AuthorizationHTML)); err != nil {
fmt.Fprintf(w, "%s", err) fmt.Fprintf(w, "%s", err)
} }
return return
} }
if r.ContentLength > maxHTTPRequestContentLength { if r.ContentLength > maxHTTPRequestContentLength {
http.Error(w, http.Error(w,
fmt.Sprintf("content length too large (%d>%d)", r.ContentLength, maxHTTPRequestContentLength), fmt.Sprintf("content length too large (%d>%d)", r.ContentLength, maxHTTPRequestContentLength),