libetl/curl

sends two user-agent

hosseinmp76 opened this issue · 3 comments

Describe the bug
I put user-agent in header but it adds another one. in HTTPRequestProvider.java in setHeaders function in second if we check:
if(request.getFirstHeader(Arguments.USER_AGENT.getOpt ()) == null)
but Arguments.USER_AGENT.getOpt () is "A"
but in request.getFirstHeader we have "user-agent" so they are not equals.

Curl command line
curl -k 'https://search.farsnews.com/Search?query=salam&category=&fromDate=2019-03-26%2000:00:00%20AM&toDate=2019-09-26%2000:00:00%20AM&page=1&size=10&sort=1' -H 'Accept: /' -H 'Referer: https://search.farsnews.com/?q=cd' -H 'X-Requested-With: XMLHttpRequest' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' -H 'Sec-Fetch-Mode: cors' --compressed

Expected behavior
send a user-agent in headers instead of two.

Good catch. I will take a look when I can.

will be fixed soon in 0.0.38, thank you for your patience (had a lot of work in my regular job)

Ok no response so closing, reopen if issue persists with 0.0.38