diff --git a/assets/index.html b/assets/index.html index 075a32b..7ef97c1 100644 --- a/assets/index.html +++ b/assets/index.html @@ -190,8 +190,8 @@

Client Tuned Response .*))?": handleDecodeBase64, "/bytes(/(?P.+))?": handleRandomBytes, "/delay/(?P[^/]+)": handleDelayedResponse, - "/drip(-(?Plines))?": handleDrip, + "/drip(-(?Plines))?(?P/.*)?": handleDrip, "/links/(?P\\d+)(/(?P\\d+))?/?": handleLinks, "/range/(?P\\d+)/?": handleRange, @@ -192,6 +192,19 @@ func handleDelayedResponse(ex *exchange.Exchange) { func handleDrip(ex *exchange.Exchange) { // Test with `curl -N localhost:3090/drip`. + extra := ex.Field("extra") + if extra != "" { + // todo: docs duplicated from index.html + ex.RespondBadRequest("Unknown extra path: " + extra + + "\nUse `/drip` or `/drip-lines` with query params:\n" + + " duration: Total number of seconds over which to stream the data. Default: 2.\n" + + " numbytes: Total number of bytes to stream. Default: 10.\n" + + " code: The HTTP status code to be used in their response. Default: 200.\n" + + " delay: An initial delay, in seconds. Default: 2.\n", + ) + return + } + writeNewLines := ex.Field("mode") == "lines" duration, err := ex.QueryParamInt("duration", 2)