We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 305f33c commit 7704f03Copy full SHA for 7704f03
webserver.go
@@ -91,7 +91,17 @@ func startWebserver(env Env, api *API) {
91
92
ctx.Response.AppendBodyString("true")
93
case "/get_cached_reference":
94
- ctx.Request.Body()
+ refNr := string(ctx.Request.Body())
95
+ if refNr == "" {
96
+ errorResp(ctx, 400, "reference number cannot be an empty string")
97
+ return
98
+ }
99
+
100
+ if api.CacheEntryExists(refNr) {
101
+ ctx.Response.AppendBodyString("true")
102
+ } else {
103
+ ctx.Response.AppendBodyString("false")
104
105
default:
106
errorResp(ctx, 404, "404 not found")
107
return
0 commit comments