mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
WebServer: Refuse to respond to requests for device files
Responding with some device files such as /dev/random never terminates, so let's just refuse that.
This commit is contained in:
parent
eb6adbabef
commit
450a24c8c9
1 changed files with 5 additions and 0 deletions
|
@ -116,6 +116,11 @@ void Client::handle_request(ReadonlyBytes raw_request)
|
|||
return;
|
||||
}
|
||||
|
||||
if (file->is_device()) {
|
||||
send_error_response(403, request);
|
||||
return;
|
||||
}
|
||||
|
||||
Core::InputFileStream stream { file };
|
||||
|
||||
send_response(stream, request, Core::guess_mime_type_based_on_filename(real_path));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue