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

Allow leaving encoded slash in UrlSegmentParameter value #2265

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

cg-finbourne
Copy link

@cg-finbourne cg-finbourne commented Sep 18, 2024

Description

We need to use path parameters which include the sequence of characters '%2F' or '%2f' in them. The constructor of UrlSegmentParameter replaces these sequences in the value with a '/' character. When using version 110.2.0 of RestSharp we would get around this by setting the Value property with the original string after the creation of the UrlSegmentParameter, but at 112.0.0 this is no longer possible as the Value property is now readonly after creation.

This pull request adds an optional parameter to the UrlSegmentParameter constructor to give control over whether the value is changed to replace '%2F' or not.

(we cannot create a new class with the desired behaviour since the UrlSegmentParameter type is used in this line https://github.com/restsharp/RestSharp/blob/dev/src/RestSharp/Request/UriExtensions.cs#L57)

Purpose

This pull request is a:

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@cg-finbourne
Copy link
Author

@dotnet-policy-service agree [company="finbourne"]

@cg-finbourne
Copy link
Author

@dotnet-policy-service agree company="finbourne"

@cg-finbourne
Copy link
Author

I have created this issue for it #2267

Copy link

github-actions bot commented Oct 4, 2024

Test Results

   35 files     35 suites   17m 18s ⏱️
  446 tests   446 ✅ 0 💤 0 ❌
3 020 runs  3 020 ✅ 0 💤 0 ❌

Results for commit 3cbd7ad.

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