Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit bdbbc0c

Browse files
authored
Strip query parameters before adding back (#1)
Strip query parameters before adding back
2 parents 7cc3115 + 97a0582 commit bdbbc0c

File tree

5 files changed

+366
-428
lines changed

5 files changed

+366
-428
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
# Output of the go coverage tool, specifically when used with LiteIDE
1212
*.out
1313

14+
*.iml
15+
.idea/
1416
.vscode
1517
vendor/*/
1618
gin/aws-lambda-go-api-proxy-gin
1719
core/aws-lambda-go-api-proxy-core
1820
sample/main
19-
sample/output-sam.yaml
21+
sample/output-sam.yaml

Gopkg.lock

Lines changed: 315 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Gopkg.toml example
2+
#
3+
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4+
# for detailed Gopkg.toml documentation.
5+
#
6+
# required = ["github.com/user/thing/cmd/thing"]
7+
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8+
#
9+
# [[constraint]]
10+
# name = "github.com/user/project"
11+
# version = "1.0.0"
12+
#
13+
# [[constraint]]
14+
# name = "github.com/user/project2"
15+
# branch = "dev"
16+
# source = "github.com/myfork/project2"
17+
#
18+
# [[override]]
19+
# name = "github.com/x/y"
20+
# version = "2.4.0"
21+
#
22+
# [prune]
23+
# non-go = false
24+
# go-tests = true
25+
# unused-packages = true
26+
27+
28+
[[constraint]]
29+
branch = "master"
30+
name = "github.com/awslabs/aws-lambda-go-api-proxy"
31+
32+
[[constraint]]
33+
name = "github.com/labstack/echo"
34+
version = "4.1.5"
35+
36+
[[constraint]]
37+
name = "github.com/onsi/gomega"
38+
version = "1.3.0"
39+
40+
[prune]
41+
go-tests = true
42+
unused-packages = true

core/request.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ func (r *RequestAccessor) EventToRequest(req events.APIGatewayProxyRequest) (*ht
141141
}
142142

143143
path := req.Path
144+
145+
// Strip off the query parameters - add them back below after decoding
146+
if strings.Index(path, "?") >= 0 {
147+
path = path[:strings.Index(path, "?")]
148+
}
149+
144150
if r.stripBasePath != "" && len(r.stripBasePath) > 1 {
145151
if strings.HasPrefix(path, r.stripBasePath) {
146152
path = strings.Replace(path, r.stripBasePath, "", 1)

0 commit comments

Comments
 (0)