User specified headers are ignored if User-Agent isn't specified
karl0ss opened this issue · comments
Karl0ss commented
Maybe I'm missing something but I am trying to pass in headers as such -
dl = Downloader(
headers=dict(one=1, two=2, three=3)
)
But they do not seem to be getting set and in dl.headers all i see is
{'User-Agent': 'parfive/1.5.1 aiohttp/3.8.1 python/3.8.1'}
Hope someone can shed some light on what I am doing wrong...
Thanks
Karl0ss commented
I would seem that you have to include a User-Agent as one of your passed in headers or it doesn't work.
Stuart Mumford commented
Yeah, I would say that's a bug, this line here:
Lines 97 to 99 in 13cbd9d
should update the headers dict if it exists but user agent isn't in it rather than overwrite it.