mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
LibWeb: Add a maximum redirects limit to FrameLoader
This prevents the browser from crashing when trying to load an infinite redirects loop. The chosen limit is based on the fetch specification: "If request's redirect count is twenty, return a network error."
This commit is contained in:
parent
84800a5b4f
commit
ce86026ac6
2 changed files with 10 additions and 0 deletions
|
@ -12,6 +12,8 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
constexpr size_t maximum_redirects_allowed = 20;
|
||||
|
||||
class FrameLoader final
|
||||
: public ResourceClient {
|
||||
public:
|
||||
|
@ -41,6 +43,7 @@ private:
|
|||
bool parse_document(DOM::Document&, const ByteBuffer& data);
|
||||
|
||||
Frame& m_frame;
|
||||
size_t m_redirects_count { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue