aboutsummaryrefslogtreecommitdiff
path: root/backend/api
diff options
context:
space:
mode:
authorJacky Zhao <[email protected]>2020-05-10 10:34:22 -0700
committerGitHub <[email protected]>2020-05-10 10:34:22 -0700
commit342e0b07c22e7b49b4db8ba93470a7a506a487c0 (patch)
treee15df2eaeb78f2fa52836330cb4c09cb42d152f3 /backend/api
parentMerge pull request #8 from jackyzha0/react (diff)
parentCheck for size of content and expiry time comparison (diff)
downloadctrl-v-342e0b07c22e7b49b4db8ba93470a7a506a487c0.tar.xz
ctrl-v-342e0b07c22e7b49b4db8ba93470a7a506a487c0.zip
Merge pull request #9 from jackyzha0/backend
Check for size of content and expiry time comparison
Diffstat (limited to 'backend/api')
-rw-r--r--backend/api/routes.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/backend/api/routes.go b/backend/api/routes.go
index ef8ccf7..a65c886 100644
--- a/backend/api/routes.go
+++ b/backend/api/routes.go
@@ -32,6 +32,7 @@ func insertFunc(w http.ResponseWriter, r *http.Request) {
// insert content
err := db.New(ip, content, expiry, title)
if err != nil {
+ w.WriteHeader(http.StatusBadRequest)
fmt.Fprintf(w, "got err: %s", err.Error())
}
}