From d4615cf547159b191d38960ffb06478501d1f5e9 Mon Sep 17 00:00:00 2001 From: Bogdan Finn Date: Sat, 29 Jul 2023 11:07:01 +0200 Subject: [PATCH] fixed outgoing cookie expires json field to be integer not string; --- cffi_dist/example_node/index.js | 4 ++-- cffi_src/types.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cffi_dist/example_node/index.js b/cffi_dist/example_node/index.js index e15566a..1c2cc1b 100644 --- a/cffi_dist/example_node/index.js +++ b/cffi_dist/example_node/index.js @@ -12,7 +12,7 @@ const tlsClientLibrary = ffi.Library('./../dist/tls-client-darwin-amd64-1.4.0.dy const requestPayload = { "tlsClientIdentifier": "chrome_103", - "followRedirects": false, + "followRedirects": true, "insecureSkipVerify": false, "withoutCookieJar": false, "withDefaultCookieJar": false, @@ -57,7 +57,7 @@ tlsClientLibrary.freeMemory(responseObject.id) const payload = { sessionId: 'my-session-id', - url: "https://example.com", + url: "https://microsoft.com", } const cookiesResponse = tlsClientLibrary.getCookiesFromSession(JSON.stringify(payload)) diff --git a/cffi_src/types.go b/cffi_src/types.go index d4841c1..88455ad 100644 --- a/cffi_src/types.go +++ b/cffi_src/types.go @@ -129,6 +129,11 @@ func (p *Timestamp) UnmarshalJSON(bytes []byte) error { return nil } +func (p *Timestamp) MarshalJSON() ([]byte, error) { + stamp := fmt.Sprintf("%d", p.Unix()) + return []byte(stamp), nil +} + // Response is the response that is sent back to the Python client. type Response struct { Id string `json:"id"`