mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Merge pull request #292 from fnproject/get-body
stop forcing GET bodies through ?payload
This commit is contained in:
@@ -38,7 +38,6 @@ import (
|
|||||||
// TODO all Datastore methods need to take unit of tenancy (app or route) at least (e.g. not just call id)
|
// TODO all Datastore methods need to take unit of tenancy (app or route) at least (e.g. not just call id)
|
||||||
// TODO limit the request body length when making calls
|
// TODO limit the request body length when making calls
|
||||||
// TODO discuss concrete policy for hot launch or timeout / timeout vs time left
|
// TODO discuss concrete policy for hot launch or timeout / timeout vs time left
|
||||||
// TODO can we get rid of 'GET url?payload' weirdness?
|
|
||||||
// TODO call env need to be map[string][]string to match headers behavior...
|
// TODO call env need to be map[string][]string to match headers behavior...
|
||||||
// TODO it may be nice to have an interchange type for Dispatch that can have
|
// TODO it may be nice to have an interchange type for Dispatch that can have
|
||||||
// all the info we need to build e.g. http req, grpc req, json, etc. so that
|
// all the info we need to build e.g. http req, grpc req, json, etc. so that
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package server
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -27,12 +26,6 @@ func (s *Server) handleRequest(c *gin.Context) {
|
|||||||
|
|
||||||
ctx := c.Request.Context()
|
ctx := c.Request.Context()
|
||||||
|
|
||||||
if c.Request.Method == "GET" {
|
|
||||||
// TODO we _could_ check the normal body, this is still weird
|
|
||||||
// TODO do we need to flush the original body if we do this? (hint: yes)
|
|
||||||
c.Request.Body = ioutil.NopCloser(strings.NewReader(c.Request.URL.Query().Get("payload")))
|
|
||||||
}
|
|
||||||
|
|
||||||
r, routeExists := c.Get(api.Path)
|
r, routeExists := c.Get(api.Path)
|
||||||
if !routeExists {
|
if !routeExists {
|
||||||
r = "/"
|
r = "/"
|
||||||
|
|||||||
Reference in New Issue
Block a user