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

Faulty link generation when creating entities with string key and slashes #2838

Closed
dankaiser1808 opened this issue May 3, 2024 · 1 comment

Comments

@dankaiser1808
Copy link

Assemblies affected

Microsoft.AspNetCore.OData Version 7.7.4 and also 8.2.5 Issue

Describe the bug

A change made a while ago in the Web API Framework has led to an issue where the link generation for entities with string keys that contain slashes is faulty. The problematic change (affects version 7.7.4) can be found in this pull request.

As a temporary workaround, we have replaced the ODataRoute class with a patched version of the class. In this patched class, the problematic code has been commented out (line 77-101 of the mentioned pull request).

Reproduce steps

  • Create an entity with a string key that contains a slash
  • Get request to the location header URL
  • results in a 404 error because it interprets the unencoded slash as a path separator

Expected behavior

For the individual segments of a link or a URI, targeted escaping should be performed, especially in the case when a primary key or an entity ID contains a slash (or similarly problematic special characters).

Thank you for taking the time to review this issue. I look forward to your feedback and am ready to assist further if needed.

@ElizabethOkerio
Copy link
Contributor

duplicate of: OData/AspNetCoreOData#1212. Will be tracked from the other repo

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

No branches or pull requests

2 participants