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

URL decode for windows #2957

Merged
merged 5 commits into from
Jan 14, 2025
Merged

URL decode for windows #2957

merged 5 commits into from
Jan 14, 2025

Conversation

dkalinowski
Copy link
Collaborator

🛠 Summary

Support for llm models containing "/" in a servable name
CVS-159405

🧪 Checklist

  • Unit tests added.
  • Change follows security best practices.

// Check if the next two characters are valid hex digits
if (i + 2 < encoded.size() &&
std::isxdigit(static_cast<unsigned char>(encoded[i + 1])) &&
std::isxdigit(static_cast<unsigned char>(encoded[i + 2]))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if i + 2 >= encoded.size(), it can be a seqfault
we should add a test with encoded string test%

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if i + 2 is >= encoded.size() we are skip the if and enter else (line 1160-1163) so there wont be an issue
however, will add test for test%

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

expected = "model/name";
output = ovms::urlDecode(input);
EXPECT_EQ(expected, output);
EXPECT_EQ("a b c d", ovms::urlDecode("a%20b%20c%20d"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add test with

"some%2"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@dkalinowski dkalinowski merged commit a2944d1 into main Jan 14, 2025
12 checks passed
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.

3 participants