Yaak Logo
Yaak
Feedback/When sending headers, send exact casing, don't lowercase

When sending headers, send exact casing, don't lowercase

E M·3 months ago
BacklogBug

Running into an issue at company where we need to Authorization with a capital A but in the timeline it seems to be sent as a lowercase authorization. Then I checked the insomnia timeline and its correctly sent as capital Authorization. The call works in Insomnia but not in Yaak and I assume its for this reason.

Mac

Comments (2)

Sign in to leave a comment.

Gregory Schier

Ya, unfortunately Rust doesn’t allow this, so there’s a longer term issue to switch to libcurl which does.

E MOP

Understood, just wanted to share some info in case it's useful.


I was curious about this and did some digging. It looks like the http crate used by reqwest/hyper lowercases headers by design, but the curl crate (Rust bindings to libcurl) preserves header casing when you use HTTP/1.1.

You probably already know this if you've looked into the libcurl option. Just wanted to mention it in case it helps.

For what it's worth, HTTP/1.1 seems fine for API testing since you're only sending one request at a time anyway. The HTTP/2 benefits like multiplexing really only matter when loading lots of resources in parallel. Maybe a settings option to choose HTTP/1.1 vs 2.0 could work, where 1.1 preserves header casing?

AI gave me this example for using the curl crate but you probably have better way:

use curl::easy::{Easy, List, HttpVersion};
let mut handle = Easy::new();
handle.url("https://api.example.com/endpoint").unwrap();
handle.http_version(HttpVersion::V11).unwrap();
let mut headers = List::new();
headers.append("Authorization: Bearer token").unwrap();
handle.http_headers(headers).unwrap();


Totally understand if there are other factors making this complicated that I'm not seeing. Just thought I'd share what I found. Either way, really appreciate the tool! Very clean, well-designed, and minimal! This is seemingly the only issue blocking me from switching from insomnia.

Type to search feedback...