mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 21:55:08 +00:00
ProtocolServer+LibProtocol: Propagate HTTP status codes to clients
Clients now receive HTTP status codes like 200, 404, etc. Note that a 404 with content is still considered a "successful" download from ProtocolServer's perspective. It's up to the client to interpret the status code. I'm not sure if this is the best API, but it'll work for now.
This commit is contained in:
parent
d9ece296f0
commit
1678aaa555
11 changed files with 20 additions and 10 deletions
|
@ -99,7 +99,7 @@ void ClientConnection::did_finish_download(Badge<Download>, Download& download,
|
|||
IPC::Dictionary response_headers;
|
||||
for (auto& it : download.response_headers())
|
||||
response_headers.add(it.key, it.value);
|
||||
post_message(Messages::ProtocolClient::DownloadFinished(download.id(), success, download.total_size().value(), buffer ? buffer->shbuf_id() : -1, response_headers));
|
||||
post_message(Messages::ProtocolClient::DownloadFinished(download.id(), success, download.status_code(), download.total_size().value(), buffer ? buffer->shbuf_id() : -1, response_headers));
|
||||
|
||||
m_downloads.remove(download.id());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue