fn: remove redundant httprouter code (#532)

*) tree from https://github.com/julienschmidt/httprouter
is already in Gin and this only seems to be parsing
parameters from URI.
This commit is contained in:
Tolga Ceylan
2017-11-22 11:58:10 -08:00
committed by Reed Allman
parent d8a1431418
commit 89dc79f0b0
4 changed files with 29 additions and 682 deletions

View File

@@ -68,9 +68,14 @@ func TestCallConfigurationRequest(t *testing.T) {
req.Header.Add("Content-Length", contentLength)
req.Header.Add("FN_PATH", "thewrongroute") // ensures that this doesn't leak out, should be overwritten
// let's assume we got there params from the URL
params := make(Params, 0, 2)
params = append(params, Param{Key: "YOGURT", Value: "garlic"})
params = append(params, Param{Key: "LEGUME", Value: "garbanzo"})
call, err := a.GetCall(
WithWriter(w), // XXX (reed): order matters [for now]
FromRequest(appName, path, req),
FromRequest(appName, path, req, params),
)
if err != nil {
t.Fatal(err)
@@ -146,6 +151,11 @@ func TestCallConfigurationRequest(t *testing.T) {
expectedEnv["FN_METHOD"] = method
expectedEnv["FN_REQUEST_URL"] = url
// add expected parameters from URL
for _, val := range params {
expectedEnv[fmt.Sprintf("FN_PARAM_%s", val.Key)] = val.Value
}
// do this before the "real" headers get sucked in cuz they are formatted differently
expectedHeaders := make(http.Header)
for k, v := range expectedEnv {