Skip to content

Preserve empty URL query parameters#1494

Open
biefan wants to merge 2 commits intoAzure:mainfrom
biefan:preserve-empty-url-query-parameters
Open

Preserve empty URL query parameters#1494
biefan wants to merge 2 commits intoAzure:mainfrom
biefan:preserve-empty-url-query-parameters

Conversation

@biefan
Copy link
Contributor

@biefan biefan commented Mar 17, 2026

Summary

  • preserve explicitly empty query parameter values when extracting URL params
  • keep empty query parameters intact when make_request_and_raise_if_error_async() rebuilds request URLs
  • add regression coverage for blank query values in both helper and request paths

Problem

extract_url_parameters() currently uses parse_qs() with its default behavior, which drops query parameters whose value is explicitly empty.

For example:

  • https://api.example.com/endpoint?api-version=&mode=test
  • http://testserver/api/test?alpha=&beta=1

currently lose the empty parameter before the request is rebuilt.

That means explicitly provided empty query parameters are silently removed from outgoing requests, which can change endpoint behavior for APIs that distinguish flag= from an absent parameter.

Testing

  • .venv/bin/pytest tests/unit/common/test_common_net_utility.py -q

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