tcp-over-http
tcp-over-http copied to clipboard
Request header support
Hi.
I have implemented the support for Arbitrary HTTP Request headers as suggested in #4. It allows the user to specify the "--req-header" argument multiple times to add as many headers as needed.
I hadn't written a line of Rust before yesterday so please be kind in your review. :-)
Kind Regards
Shaun.
async fn init_http_session(target: &Url, req_headers: &[String]) -> Trace<Uuid> {
let mut req = CLIENT.get(join_url(target, ["open"]));
println!("req_headers: {:?}", req_headers);
for req_header in req_headers {
let (name, value) = req_header.split_once(": ").unwrap();
req = req.header(name, value);
}
...
rest should be correct (i dont know what that /tmp git submodule thing is, does, is for)
Thanks for implementing. Looks good in general.
Why are we inserting "key" and "value" into the headers map though?
I am currently on mobile, will look at it and test it on pc later.
"Why are we inserting "key" and "value" into the headers map though?" artifact from the example i gave in https://github.com/julianbuettner/tcp-over-http/issues/4
(i dont know what that /tmp git submodule thing is, does, is for)
Sorry. That's junk. Can I delete that from the PR in some way or do I need to create a new PR?
You can simply delete the line, commit and push it to your branch.