Skip to content

Fix protocol string in SimulateDataverseFunction.GetRequestUri - #686

Open
Anwarul Haq (Anwarluck) wants to merge 1 commit into
microsoft:mainfrom
Anwarluck:fix/simulatedataverse-http-1.1-protocol-string
Open

Fix protocol string in SimulateDataverseFunction.GetRequestUri#686
Anwarul Haq (Anwarluck) wants to merge 1 commit into
microsoft:mainfrom
Anwarluck:fix/simulatedataverse-http-1.1-protocol-string

Conversation

@Anwarluck

Copy link
Copy Markdown

Fixes #667

GetRequestUri parses a raw HTTP request line like:

GET accounts?%24select=...&%24count=true HTTP/1.1

by stripping the GET prefix and then trying to strip a trailing " HTTPS/1.1" before building the relative Uri. But request lines here always end in HTTP/1.1, not HTTPS/1.1 — that's true both for real Dataverse OData batch payloads and for this project's own test fixtures in SimulateDataverseFunctionTests.cs (e.g. the BatchData test 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=true becomes $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 real HTTP/1.1 format this fix targets.

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
@Anwarluck
Anwarul Haq (Anwarluck) requested a review from a team as a code owner August 26, 2026 16:29
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.

SimulateDataverse tries to replace HTTPS/1.1 when it should be HTTP/1.1

1 participant