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

Encode tracker API token in HTTP requests #422

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Dec 26, 2023

When the API token contains special characters like: 123g7#@agJtWFSgkdA5R$K22yeo$k6IhNq%T2$r

The value must be URL-encoded like this:

http://tracker.torrust-demo.com:1212/v1/stats?token=123g7%23%40agJtWFSgkdA5R%24K22yeo%24k6IhNq%25T2%24r

Instead of using the token directly:

http://tracker.torrust-demo.com:1212/v1/stats?token=123g7#@agJtWFSgkdA5R$K22yeo$k6IhNq%T2$r

This PR also fixes the issue #391

@josecelano
Copy link
Member Author

ACK 860de14

@codecov-commenter
Copy link

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (373493f) 42.99% compared to head (860de14) 42.89%.

Files Patch % Lines
src/tracker/api.rs 0.00% 12 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #422      +/-   ##
===========================================
- Coverage    42.99%   42.89%   -0.10%     
===========================================
  Files           80       80              
  Lines         4922     4933      +11     
===========================================
  Hits          2116     2116              
- Misses        2806     2817      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano merged commit a471a5b into torrust:develop Dec 26, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Fix tracker API error token not valid
2 participants