diff options
| author | Ryan Mehri <[email protected]> | 2020-05-12 09:29:49 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-12 09:29:49 -0600 |
| commit | c0fc08d77570232cfda3f6e2bdbac2c3bf1aafeb (patch) | |
| tree | 9463f3be987993bda22ef4bfc3a56c9174fceee8 /backend/api | |
| parent | Merge pull request #17 from jackyzha0/password (diff) | |
| parent | working no pass rendering (diff) | |
| download | ctrl-v-c0fc08d77570232cfda3f6e2bdbac2c3bf1aafeb.tar.xz ctrl-v-c0fc08d77570232cfda3f6e2bdbac2c3bf1aafeb.zip | |
Merge pull request #18 from jackyzha0/no-pass-rendering
no password paste rendering
Diffstat (limited to 'backend/api')
| -rw-r--r-- | backend/api/routes.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/backend/api/routes.go b/backend/api/routes.go index f8d2e4f..ff43714 100644 --- a/backend/api/routes.go +++ b/backend/api/routes.go @@ -38,7 +38,8 @@ func insertFunc(w http.ResponseWriter, r *http.Request) { hash, err := db.New(ip, content, expiry, title, password) if err != nil { w.WriteHeader(http.StatusBadRequest) - fmt.Fprintf(w, "got err: %s", err.Error()) + fmt.Fprintf(w, "%s", err.Error()) + return } // if successful return paste hash @@ -75,14 +76,14 @@ func handleGetPaste(w http.ResponseWriter, r *http.Request, parsedPassword strin // if hash was not found if err == cache.PasteNotFound { w.WriteHeader(http.StatusNotFound) - fmt.Fprintf(w, "got err: %s", err) + fmt.Fprintf(w, "%s", err) return } // if paste is password protected if err == cache.UserUnauthorized { w.WriteHeader(http.StatusUnauthorized) - fmt.Fprintf(w, "got err: %s", err) + fmt.Fprintf(w, "%s", err) return } |