mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +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
Notes:
sideshowbarker
2024-07-18 12:26:50 +09:00
Author: https://github.com/MaxWipfli
Commit: 450a24c8c9
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
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