Skip to content

Commit 949ae2d

Browse files
committed
updated dependencies;
1 parent 86a2061 commit 949ae2d

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module github.com/bogdanfinn/tls-client-api
33
go 1.20
44

55
require (
6-
github.com/bogdanfinn/fhttp v0.5.22
7-
github.com/bogdanfinn/tls-client v1.3.12
6+
github.com/bogdanfinn/fhttp v0.5.23
7+
github.com/bogdanfinn/tls-client v1.4.0
88
github.com/gin-gonic/gin v1.8.1
99
github.com/google/uuid v1.3.0
1010
github.com/justtrackio/gosoline v0.3.99

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwj
228228
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
229229
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
230230
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
231-
github.com/bogdanfinn/fhttp v0.5.22 h1:U1jhZRtuaOanWWcm1WdMFnwMvSxUQgvO6berqAVTc5o=
232-
github.com/bogdanfinn/fhttp v0.5.22/go.mod h1:brqi5woc5eSCVHdKYBV8aZLbO7HGqpwyDLeXW+fT18I=
233-
github.com/bogdanfinn/tls-client v1.3.12 h1:jpNj7owMY/oULUQyAhAv6tRFkliFGLyr8Qx1ZZY/gp8=
234-
github.com/bogdanfinn/tls-client v1.3.12/go.mod h1:Q46nwIm0wPCweDM3XZcupxEIsTOWo3HVYSSsDj02/Qo=
231+
github.com/bogdanfinn/fhttp v0.5.23 h1:4Xb5OjYArB8GpnUw4A4r5jmt8UW0/Cvey3R9nS2dC9U=
232+
github.com/bogdanfinn/fhttp v0.5.23/go.mod h1:brqi5woc5eSCVHdKYBV8aZLbO7HGqpwyDLeXW+fT18I=
233+
github.com/bogdanfinn/tls-client v1.4.0 h1:ptZmkvVyRTjMFPc3Kevholf+ioePkCM5oj3qkOmOuoM=
234+
github.com/bogdanfinn/tls-client v1.4.0/go.mod h1:lgtqsHjoJYQMPz6H08bc8t30bmUaYnVjwtfVEzMGJDs=
235235
github.com/bogdanfinn/utls v1.5.16 h1:NhhWkegEcYETBMj9nvgO4lwvc6NcLH+znrXzO3gnw4M=
236236
github.com/bogdanfinn/utls v1.5.16/go.mod h1:mHeRCi69cUiEyVBkKONB1cAbLjRcZnlJbGzttmiuK4o=
237237
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=

internal/tls-client-api/api/get-cookies-handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (fh GetCookiesHandler) Handle(ctx context.Context, request *apiserver.Reque
5555

5656
out := tls_client_cffi_src.CookiesFromSessionOutput{
5757
Id: uuid.New().String(),
58-
Cookies: cookies,
58+
Cookies: transformCookies(cookies),
5959
}
6060

6161
jsonResponse, marshallError := json.Marshal(out)

internal/tls-client-api/api/utils.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func handleErrorResponse(logger log.Logger, sessionId string, withSession bool,
2626
return apiserver.NewJsonResponse(resp), nil
2727
}
2828

29-
func buildCookies(cookies []tls_client_cffi_src.CookieInput) []*http.Cookie {
29+
func buildCookies(cookies []tls_client_cffi_src.Cookie) []*http.Cookie {
3030
var ret []*http.Cookie
3131

3232
for _, cookie := range cookies {
@@ -41,3 +41,21 @@ func buildCookies(cookies []tls_client_cffi_src.CookieInput) []*http.Cookie {
4141

4242
return ret
4343
}
44+
45+
func transformCookies(cookies []*http.Cookie) []tls_client_cffi_src.Cookie {
46+
var ret []tls_client_cffi_src.Cookie
47+
48+
for _, cookie := range cookies {
49+
ret = append(ret, tls_client_cffi_src.Cookie{
50+
Name: cookie.Name,
51+
Value: cookie.Value,
52+
Path: cookie.Path,
53+
Domain: cookie.Domain,
54+
Expires: tls_client_cffi_src.Timestamp{
55+
Time: cookie.Expires,
56+
},
57+
})
58+
}
59+
60+
return ret
61+
}

0 commit comments

Comments
 (0)