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

CVAT should set a custom User-Agent for its HTTP requests #5598

Closed
2 tasks done
SpecLad opened this issue Jan 17, 2023 · 1 comment · Fixed by #5705
Closed
2 tasks done

CVAT should set a custom User-Agent for its HTTP requests #5598

SpecLad opened this issue Jan 17, 2023 · 1 comment · Fixed by #5705

Comments

@SpecLad
Copy link
Contributor

SpecLad commented Jan 17, 2023

My actions before raising this issue

Expected Behaviour

When you create a task with remote sources and specify an image URL, CVAT should make HTTP requests with a custom User-Agent header (for example, CVAT/2.3.0 (https://cvat.ai/)). Same for any other requests that CVAT makes (such as webhooks).

Current Behaviour

It uses a generic User-Agent header (currently python-requests/2.26.0).

Possible Solution

Self-explanatory.

Steps to Reproduce (for bugs)

  1. Go to https://app.cvat.ai/tasks/create.
  2. Fill out mandatory fields.
  3. Select "Remote sources" and enter https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Bicolor_he-cat.JPG/1280px-Bicolor_he-cat.JPG into the textbox.
  4. Press "Submit & Open" and watch it fail (see below for an explanation)

Context

I was trying to create a test task using images from Wikipedia, but it wasn't working. I eventually found that the Wikimedia Foundation has a user agent policy that prohibits requests that use generic User-Agent strings.

I think we should comply with this policy. It would allow downloading images from Wikipedia (and any websites with similar policies), and it would be helpful for website administrators who want to know who downloads their images.

Your Environment

Reproduced with app.cvat.ai.

@zhiltsov-max
Copy link
Contributor

I think we should also use a custom user-agent in SDK. Currently, there we have OpenAPI-Generator/2.0-alpha/python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants