[Webkit-unassigned] [Bug 263931] Web Inspector: Change the format for Copy HTTP Response/Request headers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 14 23:51:47 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=263931

--- Comment #2 from Karl Dubost <karlcow at apple.com> ---
The menu is defined on 
https://github.com/WebKit/WebKit/blob/259a471d12137011bc115533fbc94bd2060fa9a7/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js#L197-L200

Then it is using
stringifyHTTPResponse

https://github.com/WebKit/WebKit/blob/259a471d12137011bc115533fbc94bd2060fa9a7/Source/WebInspectorUI/UserInterface/Models/Resource.js#L1272C5-L1291C6

which has hardcoded `:status:`

```
            lines.push(`:status: ${this.statusCode}`);
```

hmm I see the rationale there to use the response defined in HTTP/2 


```
stringifyHTTPResponse()
    {
        let lines = [];

        let protocol = this.protocol || "";
        if (protocol === "h2") {
            // HTTP/2 Response pseudo headers:
            // https://tools.ietf.org/html/rfc7540#section-8.1.2.4
            lines.push(`:status: ${this.statusCode}`);
        } else {
            // HTTP/1.1 response status line:
            // https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
            lines.push(`${protocol ? protocol.toUpperCase() + " " : ""}${this.statusCode} ${this.statusText}`);
        }

        for (let key in this.responseHeaders)
            lines.push(`${key}: ${this.responseHeaders[key]}`);

        return lines.join("\n") + "\n";
    }
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241015/bbc8652e/attachment.htm>


More information about the webkit-unassigned mailing list