Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eliax1996 committed Nov 22, 2023
1 parent 2599dd5 commit 2cec245
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions karapace/schema_registry_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,10 @@ async def _forward_if_not_ready_to_serve(self, request: HTTPRequest) -> None:
status=HTTPStatus.SERVICE_UNAVAILABLE,
)
else:
url = f"{master_url}{request.url.path}"
await self._forward_request_remote(
request=request,
body=request.json,
url=url,
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url)),
content_type=request.get_header("Content-Type"),
method=request.method,
)
Expand Down Expand Up @@ -624,7 +623,7 @@ async def config_set(self, content_type: str, *, request: HTTPRequest, user: Use
await self._forward_request_remote(
request=request,
body=body,
url=compute_forwarded_url(master_url=master_url, request_url=request.url),
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url)),
content_type=content_type,
method="PUT",
)
Expand Down Expand Up @@ -700,7 +699,7 @@ async def config_subject_set(
await self._forward_request_remote(
request=request,
body=request.json,
url=compute_forwarded_url(master_url=master_url, request_url=request.url),
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url)),
content_type=content_type,
method="PUT",
)
Expand Down Expand Up @@ -728,7 +727,7 @@ async def config_subject_delete(
await self._forward_request_remote(
request=request,
body=request.json,
url=compute_forwarded_url(master_url=master_url, request_url=request.url),
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url)),
content_type=content_type,
method="PUT",
)
Expand Down Expand Up @@ -805,7 +804,7 @@ async def subject_delete(
await self._forward_request_remote(
request=request,
body={},
url=compute_forwarded_url(master_url=master_url, request_url=request.url + f"?permanent={permanent}"),
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url) + f"?permanent={permanent}"),
content_type=content_type,
method="DELETE",
)
Expand Down Expand Up @@ -913,7 +912,7 @@ async def subject_version_delete(
await self._forward_request_remote(
request=request,
body={},
url=compute_forwarded_url(master_url=master_url, request_url=request.url + f"?permanent={permanent}"),
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url) + f"?permanent={permanent}"),
content_type=content_type,
method="DELETE",
)
Expand Down Expand Up @@ -1303,7 +1302,7 @@ async def subject_post(
await self._forward_request_remote(
request=request,
body=body,
url=compute_forwarded_url(master_url=master_url, request_url=request.url),
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url)),
content_type=content_type,
method="POST",
)
Expand Down Expand Up @@ -1345,7 +1344,7 @@ async def set_topic_require_validation(
await self._forward_request_remote(
request=request,
body=None,
url=compute_forwarded_url(master_url=master_url, request_url=request.url),
url=compute_forwarded_url(master_url=master_url, request_url=str(request.url)),
content_type=content_type,
method="POST",
)
Expand Down

0 comments on commit 2cec245

Please sign in to comment.