Skip to content
Draft
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
8 changes: 8 additions & 0 deletions osc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ def http_request(method: str, url: str, headers=None, data=None, file=None):
http.client.print(40 * '-')
http.client.print(method, url)

if method != "GET" and os.environ['OSC_HTTP_MANUAL_APPROVE']:
print("osc is going to send "+ method +" request to " + urlopen_url)
if data:
print(data.decode("utf-8"))
y = input("press 'y' to continue or any other key to cancel")
if y != 'y' and y != 'Y':
raise Exception("Manual abort")

try:
response = pool.urlopen(
method, urlopen_url, body=data, headers=headers,
Expand Down
Loading