Fix protocol string in SimulateDataverseFunction.GetRequestUri - #686
Open
Anwarul Haq (Anwarluck) wants to merge 1 commit into
Open
Conversation
GetRequestUri strips a trailing " HTTPS/1.1" from the request line before building the relative Uri, but the actual batch request lines (both in production Dataverse OData batch payloads and in this project's own test fixtures) end in " HTTP/1.1", not HTTPS. Since the replace never matches, the trailing " HTTP/1.1" stays attached to the last query parameter's value, corrupting it. Fixes microsoft#667
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #667
GetRequestUriparses a raw HTTP request line like:by stripping the
GETprefix and then trying to strip a trailing" HTTPS/1.1"before building the relativeUri. But request lines here always end inHTTP/1.1, notHTTPS/1.1— that's true both for real Dataverse OData batch payloads and for this project's own test fixtures inSimulateDataverseFunctionTests.cs(e.g. theBatchDatatest builds a request ending in...&%24count=true HTTP/1.1).Since the replace never matches, the trailing
" HTTP/1.1"stays attached to the constructed URI text, which corrupts the value of whatever query parameter happens to be last (e.g.$count=truebecomes$count=true HTTP/1.1), matching the "incorrectly parsed query parameters" symptom described in the issue.Changed the replaced string from
" HTTPS/1.1"to" HTTP/1.1".I don't have a .NET toolchain set up to run the test suite locally, so I traced this by reading the code and cross-checking it against the existing test fixtures in
SimulateDataverseFunctionTests.cs, which already use the realHTTP/1.1format this fix targets.