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

[GSoC2024] Decode uploaded filename from request header #7646

Merged
merged 10 commits into from
Apr 4, 2024

Conversation

AndrewLuGit
Copy link
Contributor

@AndrewLuGit AndrewLuGit commented Mar 20, 2024

Motivation and context

This fixes issue #6528, as filenames with special characters must be decoded from the MIME header back into UTF-8.

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@nmanovic nmanovic requested review from azhavoro and removed request for nmanovic and Marishka17 March 22, 2024 14:05
Copy link
Contributor

@azhavoro azhavoro left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Please consider to add a API test to check this case.

cvat/apps/engine/views.py Outdated Show resolved Hide resolved
@@ -0,0 +1,4 @@
### Fixed

- Creating tasks with special characters in uploaded filename
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure that other upload-related functions work with such characters in file names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bulk (non-TUS) uploads work fine. I'm not sure how to do remote and cloud uploads. Can I test those through the testing framework?

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Merging #7646 (2ed9c22) into develop (02889ee) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7646      +/-   ##
===========================================
- Coverage    83.36%   83.34%   -0.02%     
===========================================
  Files          373      373              
  Lines        39722    39722              
  Branches      3747     3747              
===========================================
- Hits         33113    33106       -7     
- Misses        6609     6616       +7     
Components Coverage Δ
cvat-ui 79.17% <ø> (-0.04%) ⬇️
cvat-server 87.21% <0.00%> (-0.01%) ⬇️

@AndrewLuGit
Copy link
Contributor Author

@azhavoro I'm not sure how to add the API test case, since this problem only happens through TUS uploads. How do I make sure a file is uploaded through TUS using the testing framework? Does the test case need to be in cypress instead of pytest?

@azhavoro
Copy link
Contributor

@azhavoro I'm not sure how to add the API test case, since this problem only happens through TUS uploads. How do I make sure a file is uploaded through TUS using the testing framework? Does the test case need to be in cypress instead of pytest?

Yes, it looks like the cypres test is the easiest way to initiate uploading via TUS.

@azhavoro
Copy link
Contributor

azhavoro commented Apr 4, 2024

Thanks for the contribution!

@azhavoro azhavoro merged commit 6c12c9e into cvat-ai:develop Apr 4, 2024
32 checks passed
@cvat-bot cvat-bot bot mentioned this pull request Apr 15, 2024
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 this pull request may close these issues.

2 participants