Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tailored user-agent in requests by HTTP-backend #645

Merged
merged 3 commits into from
Nov 25, 2022

Conversation

juhoinkinen
Copy link
Member

@juhoinkinen juhoinkinen commented Nov 21, 2022

The http-backend uses requests library, and so the headers have now user-agent python-requests/2.28.1, which is shown e.g. in logs of the targeted server.

It is better to use a user-agent tailored for Annif. This PR changes the user-agent that http-backend sends in request headers to Annif/<version>, e.g. currently to Annif/0.60.0.dev0.

@juhoinkinen juhoinkinen added this to the 0.60 milestone Nov 21, 2022
@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 99.54% // Head: 99.55% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (27f1bb1) compared to base (02e60ed).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #645   +/-   ##
=======================================
  Coverage   99.54%   99.55%           
=======================================
  Files          87       87           
  Lines        5968     6004   +36     
=======================================
+ Hits         5941     5977   +36     
  Misses         27       27           
Impacted Files Coverage Δ
annif/backend/http.py 100.00% <100.00%> (ø)
tests/test_backend_http.py 100.00% <100.00%> (ø)
annif/parallel.py 100.00% <0.00%> (ø)
annif/registry.py 100.00% <0.00%> (ø)
tests/test_cli.py 100.00% <0.00%> (ø)
tests/test_parallel.py 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@juhoinkinen juhoinkinen marked this pull request as ready for review November 24, 2022 13:51
Copy link
Member

@osma osma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@juhoinkinen juhoinkinen merged commit 8b9260a into master Nov 25, 2022
@juhoinkinen juhoinkinen deleted the annif-user-agent branch November 25, 2022 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants