@@ -29,13 +29,13 @@ func newFunctionURLRequest() events.LambdaFunctionURLRequest {
29
29
Authorizer : nil ,
30
30
APIID : "0dhg9709da0dhg9709da0dhg9709da" ,
31
31
DomainName : "0dhg9709da0dhg9709da0dhg9709da.lambda-url.eu-central-1.on.aws" ,
32
- DomainPrefix : "" ,
32
+ DomainPrefix : "0dhg9709da0dhg9709da0dhg9709da " ,
33
33
Time : "" ,
34
34
TimeEpoch : 0 ,
35
35
HTTP : events.LambdaFunctionURLRequestContextHTTPDescription {
36
36
Method : "POST" ,
37
37
Path : "/example" ,
38
- Protocol : "" ,
38
+ Protocol : "HTTP/1.1 " ,
39
39
SourceIP : "127.0.0.1" ,
40
40
UserAgent : "Go-http-client/1.1" ,
41
41
},
@@ -95,7 +95,7 @@ func newFiberAdapter() handler.AdapterFunc {
95
95
result := make (map [string ]string )
96
96
result ["Method" ] = ctx .Method ()
97
97
result ["URL" ] = ctx .Request ().URI ().String ()
98
- result ["RemoteAddr" ] = ctx .IP ()
98
+ result ["RemoteAddr" ] = ctx .IP () + ":http" // fiber uses net.ResolveTCPAddr which resolves :http to :80
99
99
result ["Body" ] = string (ctx .Body ())
100
100
101
101
return ctx .JSON (result )
@@ -108,6 +108,7 @@ func TestFunctionURLGET(t *testing.T) {
108
108
adapters := map [string ]handler.AdapterFunc {
109
109
"vanilla" : newVanillaAdapter (),
110
110
"echo" : newEchoAdapter (),
111
+ "fiber" : newFiberAdapter (),
111
112
}
112
113
113
114
for name , a := range adapters {
@@ -143,6 +144,8 @@ func TestFunctionURLGET(t *testing.T) {
143
144
}
144
145
145
146
if ! reflect .DeepEqual (body , expectedBody ) {
147
+ t .Logf ("expected: %v" , expectedBody )
148
+ t .Logf ("actual: %v" , body )
146
149
t .Error ("request/response didnt match" )
147
150
}
148
151
})
0 commit comments