mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-11 01:50:59 +00:00
Add to instead of replace the HTTP client headers.
This commit is contained in:
parent
92c4ca9a5e
commit
228bce1ba2
2 changed files with 3 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ Changes:
|
|||
Fixes:
|
||||
- checking: Correct typos in the proxy handling code.
|
||||
Closes: GH bug #536
|
||||
- checking: Add to default HTTP client headers instead of replacing.
|
||||
- cmdline: Reactivate paging of help pages.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,9 +44,9 @@ def new_request_session(config, cookies):
|
|||
if cookies:
|
||||
session.cookies = cookies
|
||||
session.max_redirects = config["maxhttpredirects"]
|
||||
session.headers = {
|
||||
session.headers.update({
|
||||
"User-Agent": config["useragent"],
|
||||
}
|
||||
})
|
||||
if config["cookiefile"]:
|
||||
for cookie in cookies.from_file(config["cookiefile"]):
|
||||
session.cookies = requests.cookies.merge_cookies(session.cookies, cookie)
|
||||
|
|
|
|||
Loading…
Reference in a new issue