mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
fix(cli): honest User-Agent tokens on jobbank and jobdanmark detail
jobbank sent a full Chrome browser string and jobdanmark's detail command a bare Mozilla/5.0. Both now use the (compatible; <portal>-cli/1.0) token per the identification posture settled in #277. Verified live: both portals serve identical responses to the honest token. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
60c735946d
commit
45513464dc
@@ -2,8 +2,7 @@ import { parse as parseHtml } from "node-html-parser"
|
|||||||
|
|
||||||
export const BASE_URL = "https://jobbank.dk"
|
export const BASE_URL = "https://jobbank.dk"
|
||||||
|
|
||||||
export const USER_AGENT =
|
export const USER_AGENT = "Mozilla/5.0 (compatible; jobbank-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"
|
|
||||||
|
|
||||||
export function writeError(error: string, code: string): void {
|
export function writeError(error: string, code: string): void {
|
||||||
process.stderr.write(JSON.stringify({ error, code }) + "\n")
|
process.stderr.write(JSON.stringify({ error, code }) + "\n")
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ export const detail = defineCommand({
|
|||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "text/html,application/xhtml+xml",
|
"Accept": "text/html,application/xhtml+xml",
|
||||||
"User-Agent": "Mozilla/5.0",
|
"User-Agent": "Mozilla/5.0 (compatible; jobdanmark-cli/1.0)",
|
||||||
},
|
},
|
||||||
signal: AbortSignal.timeout(15000),
|
signal: AbortSignal.timeout(15000),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user