Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMHO this makes stuff rather more readable/scannable. Some people may not like it, so I added it as an option. Will automatically align to the longest header; I modified the sortHeaderKeys() so we don't need to do an extra loop for it. Also pass the Host header to printHeaders() so it's aligned too. Do some special-fu to make sure it still prints as the first. Before; * Request at 2024-09-19 15:19:15.459694244 +0100 IST m=+1.001660288 * Request to http://localhost:8081/api/3/ping > GET /api/3/ping HTTP/1.1 > Host: localhost:8081 > Accept: application/json; charset=utf-8 > Authorization: ApiKey ████████████████████ > Content-Type: application/json; charset=utf-8 > User-Agent: alfred/ < HTTP/1.1 200 OK < Cache-Control: no-store,no-cache < Content-Length: 88 < Content-Security-Policy: default-src 'self'; img-src 'self' blob: data:; < Content-Type: application/json; charset=utf-8 < Date: Thu, 19 Sep 2024 14:19:15 GMT < Referrer-Policy: same-origin < X-Content-Type-Options: nosniff < X-Frame-Options: SAMEORIGIN < X-Powered-By: Alfred < X-Xss-Protection: 1; mode=block { "ftm_version": "3.7.0", "role": 4, "title": "Alfred", "version": "d67f396b" } * Request took 9.251101ms After: * Request at 2024-09-19 15:18:45.255328802 +0100 IST m=+1.001249794 * Request to http://localhost:8081/api/3/ping > GET /api/3/ping HTTP/1.1 > Host: localhost:8081 > Accept: application/json; charset=utf-8 > Authorization: ApiKey ████████████████████ > Content-Type: application/json; charset=utf-8 > User-Agent: alfred/ < HTTP/1.1 200 OK < Cache-Control: no-store,no-cache < Content-Length: 88 < Content-Security-Policy: default-src 'self'; img-src 'self' blob: data:; < Content-Type: application/json; charset=utf-8 < Date: Thu, 19 Sep 2024 14:18:45 GMT < Referrer-Policy: same-origin < X-Content-Type-Options: nosniff < X-Frame-Options: SAMEORIGIN < X-Powered-By: Alfred < X-Xss-Protection: 1; mode=block { "ftm_version": "3.7.0", "role": 4, "title": "Alfred", "version": "d67f396b" } * Request took 9.251101ms
- Loading branch information