mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 08:36:25 +00:00
fix(cli): honest User-Agent token on linkedin-search
The last portal CLI still sending a full Chrome spoof after #283 and
4551346. Live-verified: search and detail endpoints serve identical
responses to Mozilla/5.0 (compatible; linkedin-search-cli/1.0).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
beb53f1a9f
commit
da12d6e38e
@@ -12,9 +12,7 @@ export function writeError(error: string, code: string): void {
|
|||||||
process.stderr.write(JSON.stringify({ error, code }) + "\n")
|
process.stderr.write(JSON.stringify({ error, code }) + "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
const UA =
|
const UA = "Mozilla/5.0 (compatible; linkedin-search-cli/1.0)"
|
||||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 " +
|
|
||||||
"(KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
|
||||||
|
|
||||||
/** Fetch HTML with exponential backoff on 429/5xx. Returns "" on a 404. */
|
/** Fetch HTML with exponential backoff on 429/5xx. Returns "" on a 404. */
|
||||||
export async function htmlFetch(url: string): Promise<string> {
|
export async function htmlFetch(url: string): Promise<string> {
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ per-file diff commands.
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- **The linkedin-search CLI identifies honestly** - its `User-Agent` was a full Chrome
|
||||||
|
browser string, the last portal CLI still spoofing after #283 and the jobbank/jobdanmark
|
||||||
|
fix. It now sends `Mozilla/5.0 (compatible; linkedin-search-cli/1.0)`, the same token
|
||||||
|
format as every other portal. Verified live on both the search and detail endpoints:
|
||||||
|
identical 200 responses with full content under the honest token.
|
||||||
|
|
||||||
- **A `.env` was committable** (`.gitignore`, `tools/security_guards.py`). `/add-portal`
|
- **A `.env` was committable** (`.gitignore`, `tools/security_guards.py`). `/add-portal`
|
||||||
can generate a skill for a portal that only returns usable content through a paid
|
can generate a skill for a portal that only returns usable content through a paid
|
||||||
fetching service, and such a skill reads an API token from the environment - but
|
fetching service, and such a skill reads an API token from the environment - but
|
||||||
|
|||||||
Reference in New Issue
Block a user