Last active
August 24, 2020 10:25
-
-
Save bfontaine/a84d19f6ba021bdc71590f81f789217b to your computer and use it in GitHub Desktop.
Extract cookies off a .har file and export them for the EditThisCookie browser extension for testing purposes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HAR to EditThisCookie converter | |
def domain: | |
.url | |
| sub("^https?://"; "") | |
| sub("/.*"; ""); | |
def cookies: | |
domain as $d | |
| .cookies|map(. + {"domain": $d, | |
# Change the values below as needed | |
"path": "/", | |
"expirationDate": (now + 86400), | |
"hostOnly": true, | |
"sameSite": "no_restriction"}); | |
.log.entries|map(.request|cookies)|flatten(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment