Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/pyob/entrance_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ def _dynamic_do_POST_method(self: ObserverHandler) -> None:
# Capture existing do_POST if it exists to avoid breaking other APIs
original_do_POST = getattr(ObserverHandler, "do_POST", None)

def _dynamic_do_POST_wrapper(self: ObserverHandler) -> None:
if self.path == "/set_target":
_dynamic_do_POST_method(self)
def _dynamic_do_POST_wrapper(instance: ObserverHandler) -> None:
if instance.path == "/set_target":
_dynamic_do_POST_method(instance)
elif original_do_POST is not None:
original_do_POST(self)
original_do_POST(instance)
else:
self.send_error(404)
instance.send_error(404)

setattr(ObserverHandler, "do_POST", _dynamic_do_POST_wrapper)

Expand Down
Loading