Skip to content

Commit

Permalink
Extract t8n arguments from daemon query string
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Nov 21, 2024
1 parent a95b7aa commit b9b7f63
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ethereum_spec_tools/evm_tools/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from socket import socket
from threading import Thread
from typing import Any, Tuple, Union
from urllib.parse import parse_qs, urlparse


def daemon_arguments(subparsers: argparse._SubParsersAction) -> None:
Expand Down Expand Up @@ -58,6 +59,16 @@ def do_POST(self) -> None:
f"--state.reward={content['state']['reward']}",
]

query_string = urlparse(self.path).query
if query_string:
query = parse_qs(
query_string,
keep_blank_values=True,
strict_parsing=True,
errors="strict",
)
args += query.get("arg", [])

self.send_response(200)
self.send_header("Content-type", "application/octet-stream")
self.end_headers()
Expand Down

0 comments on commit b9b7f63

Please sign in to comment.