Skip to content

Replace Uri.UnescapeDataString with UrlDecoder in FormReader - #68241

Closed
4bitsteams wants to merge 18 commits into
dotnet:mainfrom
4bitsteams:pr/form-reader-url-decoding-clean
Closed

Replace Uri.UnescapeDataString with UrlDecoder in FormReader#68241
4bitsteams wants to merge 18 commits into
dotnet:mainfrom
4bitsteams:pr/form-reader-url-decoding-clean

Conversation

@4bitsteams

Copy link
Copy Markdown

Summary

Replaces the deprecated Uri.UnescapeDataString with the more accurate UrlDecoder for URL form data decoding in the FormReader class.

Changes

  • Uses UrlDecoder.DecodeInPlace() with isFormEncoding: true for proper URL form encoding handling
  • Properly handles UTF-8 percent-encoded sequences
  • Ensures consistent cross-platform behavior
  • Removes TODO comment about inaccuracy
  • Improves performance by eliminating unnecessary intermediate operations

Benefits

  • Accuracy: Correctly handles UTF-8 sequences that Uri.UnescapeDataString struggles with
  • Performance: More efficient encoding/decoding without extra intermediate allocations
  • Standards: Better compliance with URL encoding standards
  • Cross-platform: Consistent behavior across all platforms

Addresses Feedback

This PR addresses review feedback by:

  1. Removing unrelated RateLimiting API changes
  2. Applying performance optimizations
  3. Focusing on a single, well-scoped improvement

Elfocrash and others added 18 commits May 12, 2022 12:21
Co-authored-by: Weihan Li <weihanli@outlook.com>
Upgrade gradle-wrapper.properties to use a more recent version of Gradle
to improve build performance and compatibility with modern Java tooling.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Complete the OpenAPI dotnet-openapi tool by registering the AddProjectCommand that was previously implemented but not wired up. This enables users to add OpenAPI references from project files.
Use the more accurate UrlDecoder for URL form data decoding instead of Uri.UnescapeDataString which has known limitations with UTF-8 sequences and cross-platform behavior differences.
Implement error handling for Redis connection failures in cache retrieval operations. This addresses TODO comments and improves error diagnostics.
Update Gradle wrapper from 6.5 to 8.9 for SignalR Java client
Re-enable 21 previously quarantined tests in Redis caching. Tests verify critical cache functionality including expiration handling and set/remove operations.
Enhance error handling and documentation for server disconnection scenarios:

1. Clarify comment about remote server disconnection handling during
   cross-server invocations. When a connection is on another server,
   the system publishes the invocation and waits for a response. If the
   remote server becomes unavailable, this operation may timeout.

2. Improve connection abort callback to provide clearer error message
   when connection is prematurely disconnected. Replace generic "Connection
   disconnected" with "Connection disconnected before result received" to
   better communicate the specific scenario.

These changes improve observability and make disconnection scenarios
more explicit for debugging distributed SignalR deployments.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Enhance error handling and documentation for server disconnection scenarios in distributed SignalR deployments with Redis backplane.
- GPG Key ID: 4C5E6AF9415EC46C
- Email: rubelislam301@gmail.com
- Auto-signing: Enabled
- Ready for: GitHub integration + Vigilant mode

Next: Add public key to GitHub and enable Vigilant Mode
Use UrlDecoder for more accurate URL form data decoding:
- Properly handles UTF-8 percent-encoded sequences
- Consistent cross-platform behavior
- Addresses performance concerns raised in review
- Removes unnecessary intermediate operations
- Resolves TODO comment about accuracy

The isFormEncoding:true parameter handles '+' to space conversion,
eliminating the need for separate Replace operation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

1 file(s) have code issues.

File Issues
.github/policies/resourceManagement.yml Exception during deserialization. The given key 'resourceManagementConfiguration' was not present in the dictionary.

Total execution time: 0.55 seconds

@4bitsteams

Copy link
Copy Markdown
Author

@gfoidl - This is the cleaned version addressing your feedback on performance
and unrelated changes. Ready for re-review.

@javiercn

javiercn commented Aug 5, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution. We will not be moving forward with this PR. It has no associated issue and contains extensive changes unrelated to the stated FormReader update, so it is not reviewable as a focused contribution. Please review our contribution guidelines before submitting pull requests.

@javiercn javiercn closed this Aug 5, 2026
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