Skip to content

Commit

Permalink
[Core] aaz: Parse and re-serialize query parameters within next link (
Browse files Browse the repository at this point in the history
Azure#26768)

* re-serialize query parameters

* remove useless import
  • Loading branch information
necusjz authored Jun 29, 2023
1 parent 67ffb1b commit 6cdcc9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/azure-cli-core/azure/cli/core/aaz/_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from azure.core.exceptions import ClientAuthenticationError, ResourceExistsError, ResourceNotFoundError, \
HttpResponseError
from azure.cli.core.azclierror import InvalidArgumentValueError
from urllib.parse import parse_qs, urljoin, urlparse

from ._arg_browser import AAZArgBrowser
from ._base import AAZUndefined, AAZBaseValue, AAZBaseType, has_value
Expand Down Expand Up @@ -292,9 +293,14 @@ def make_request(self):
"""
if self.ctx.next_link:
# support making request for next link
_parsed_next_link = urlparse(self.ctx.next_link)
_next_request_params = {
key: [quote(v) for v in value]
for key, value in parse_qs(_parsed_next_link.query).items()
}
request = self.client._request(
"GET", self.ctx.next_link, {}, self.header_parameters,
self.content, self.form_content, None)
"GET", urljoin(self.ctx.next_link, _parsed_next_link.path), _next_request_params,
self.header_parameters, self.content, self.form_content, None)

elif self.method in ("GET",):
request = self.client._request(
Expand Down

0 comments on commit 6cdcc9d

Please sign in to comment.