Skip to content

Add NormalizePath middleware to cleanup url - #5946

Merged
timvisee merged 4 commits into
qdrant:devfrom
damiansan239:cleanup-doubleslash-requests
Feb 6, 2025
Merged

timvisee merged 4 commits into
qdrant:devfrom
damiansan239:cleanup-doubleslash-requests

Conversation

@damiansan239

@damiansan239 damiansan239 commented Feb 4, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds an actix middleware that remove double slashes from API requests.

This should fix #5826 and also as an addition, help avoid path traversal attacks

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@damiansan239 damiansan239 changed the title feat: add NormalizePath middleware to cleanup url Add NormalizePath middleware to cleanup url Feb 4, 2025
@generall

generall commented Feb 4, 2025

Copy link
Copy Markdown
Member

Thanks @yungwarlock

LGTM, is there anything additional to this PR to make it ready to merge?

@damiansan239
damiansan239 marked this pull request as ready for review February 5, 2025 09:30
@damiansan239

Copy link
Copy Markdown
Contributor Author

I was setting up my dev environment throughout yesterday i forgot about the PR

@damiansan239

Copy link
Copy Markdown
Contributor Author

I will add some test cases to show it's working

Comment thread tests/basic_api_test.sh Resolved
Co-authored-by: Andrey Vasnetsov <[email protected]>
Comment thread tests/basic_api_test.sh Resolved

@timvisee timvisee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! 🙏

@timvisee
timvisee merged commit 01a9970 into qdrant:dev Feb 6, 2025
timvisee pushed a commit that referenced this pull request Feb 11, 2025
* feat: add NormalizePath middleware to cleanup url

Signed-off-by: Damian <[email protected]>

* Cleaned up comment on Normalize Path

* test: add test case to validate behavior

* Update tests/basic_api_test.sh

Co-authored-by: Andrey Vasnetsov <[email protected]>

---------

Signed-off-by: Damian <[email protected]>
Co-authored-by: Andrey Vasnetsov <[email protected]>
@timvisee timvisee mentioned this pull request Feb 11, 2025
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.

4 participants