Skip to content

feat(read): add --cookie-file for header and Netscape cookies - #5

Open
jieyuexing wants to merge 1 commit into
lencx:mainfrom
jieyuexing:feat/cookie-file
Open

feat(read): add --cookie-file for header and Netscape cookies#5
jieyuexing wants to merge 1 commit into
lencx:mainfrom
jieyuexing:feat/cookie-file

Conversation

@jieyuexing

Copy link
Copy Markdown

Direct opsail read of an HTTP(S) URL can send cookies from a file path (--cookie-file / options.cookieFile). The file is either one Cookie request-header line or a Netscape cookies.txt dump.

A header line is sent unchanged to that URL. Netscape records are sent only when they match the request host, path, Secure flag, and expiry. Other hosts in the same file are ignored.

This is for static HTTP only. It cannot be combined with --launch or --cdp. Pages that need a real browser session should still use --cdp.

Cookie values never appear on the command line, in Debug output, in logs, or in ReadResult. Callers pass a file path, not the secret.

Direct `opsail read` of an HTTP(S) URL can send cookies from a file path
(`--cookie-file` / `options.cookieFile`). The file is either one Cookie
request-header line or a Netscape cookies.txt dump.

A header line is sent unchanged to that URL. Netscape records are sent
only when they match the request host, path, Secure flag, and expiry.
Other hosts in the same file are ignored.

This is for static HTTP only. It cannot be combined with `--launch` or
`--cdp`. Pages that need a real browser session should still use `--cdp`.

If cookies are set and the server redirects:
- same host, HTTP to HTTPS: follow, and choose cookies again for the HTTPS URL
- different host, or HTTPS to HTTP: stop; do not send cookies there

Cookie values never appear on the command line, in Debug output, in logs,
or in ReadResult. Callers pass a file path, not the secret.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant