Skip to content

Commit

Permalink
Merge pull request #1030 from SamWilsn/daemon-args
Browse files Browse the repository at this point in the history
Extract t8n arguments from daemon query string
  • Loading branch information
gurukamath authored Nov 12, 2024
2 parents 8fe0704 + 1dda9b0 commit 5e8aeb3
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 5e8aeb3

Please sign in to comment.