Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 11, 2024
1 parent 0049132 commit e5fefd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions proxy/plugin/reverse_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ def routes(self) -> List[Union[str, Tuple[str, List[bytes]]]]:
return [
# A static route
(
r"/get$",
[b"http://httpbingo.org/get", b"https://httpbingo.org/get"],
r'/get$',
[b'http://httpbingo.org/get', b'https://httpbingo.org/get'],
),
# A dynamic route to catch requests on "/get/<int>""
# See "handle_route" method below for what we do when
# this pattern matches.
r"/get/(\d+)$",
r'/get/(\d+)$',
]

def handle_route(self, request: HttpParser, pattern: RePattern) -> Url:
"""For our example dynamic route, we want to simply convert
any incoming request to "/get/1" into "/get?id=1" when serving from upstream.
"""
choice: Url = Url.from_bytes(b"http://httpbingo.org/get")
choice: Url = Url.from_bytes(b'http://httpbingo.org/get')
assert request.path
result = re.search(pattern, request.path.decode())
if not result or len(result.groups()) != 1:
Expand Down

0 comments on commit e5fefd1

Please sign in to comment.