mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibHTTP: Implement getting the correct reason phrase from HttpResponse
This adds a reason_phrase() getter and a static reason_phrase_for_code() to the HttpResponse class. It also changes the class to use east const style.
This commit is contained in:
parent
977b3509f2
commit
631faec32f
Notes:
sideshowbarker
2024-07-18 12:26:35 +09:00
Author: https://github.com/MaxWipfli
Commit: 631faec32f
Pull-request: https://github.com/SerenityOS/serenity/pull/7879
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gunnarbeutner
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/stelar7
2 changed files with 63 additions and 1 deletions
|
@ -21,7 +21,10 @@ public:
|
|||
}
|
||||
|
||||
int code() const { return m_code; }
|
||||
const HashMap<String, String, CaseInsensitiveStringTraits>& headers() const { return m_headers; }
|
||||
StringView reason_phrase() const { return reason_phrase_for_code(m_code); }
|
||||
HashMap<String, String, CaseInsensitiveStringTraits> const& headers() const { return m_headers; }
|
||||
|
||||
static StringView reason_phrase_for_code(int code);
|
||||
|
||||
private:
|
||||
HttpResponse(int code, HashMap<String, String, CaseInsensitiveStringTraits>&&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue