Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
crawler_rate_limit
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
crawler_rate_limit
Commits
9b25314b
Commit
9b25314b
authored
7 months ago
by
Vojislav Jovanovic
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3453992
: Update list of paths to ignore
parent
52b96c47
No related branches found
No related tags found
1 merge request
!3
Update list of paths to ignore
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/RateLimitManager.php
+15
-3
15 additions, 3 deletions
src/RateLimitManager.php
with
15 additions
and
3 deletions
src/RateLimitManager.php
+
15
−
3
View file @
9b25314b
...
...
@@ -133,17 +133,29 @@ class RateLimitManager implements RateLimitManagerInterface {
// Some page requests trigger additional request which should not be
// counted towards the limit. Such requests are ignored.
// Image module: generate image derivatives of publicly available files.
// - path:
/[file_public_path]
/styles/ (e.g. /sites/default/files/styles)
// - path:
public:/
/styles/ (e.g. /sites/default/files/styles)
// Image module: generate image derivatives of private files.
// - path: /system/files/styles/
// System module: generate optimized CSS/JS asset files.
// - Drupal 10.0 and lower: public://css and public://js
// - Drupal 10.1 and higher: assets://css and assets://js
// History module: mark a node as read by the current user.
// - path: /history/{node}/read (e.g. /history/18/read)
// Contextual Links module: render contextual links.
// - path: /contextual/render
// Media module: render an oEmbed resource.
// - path: /media/oembed.
$styles_public
=
PublicStream
::
basePath
()
.
'/styles/'
;
$pattern
=
"@(
$styles_public
)|(/system/files/styles/)|(/history/\d+/read)|(/contextual/render)|(/media/oembed)@"
;
$public_stream
=
PublicStream
::
basePath
();
$stream_wrappers
=
"(
$public_stream
)"
;
// phpcs:disable
if
(
class_exists
(
'\Drupal\Core\StreamWrapper\AssetsStream'
))
{
$assets_stream
=
\Drupal\Core\StreamWrapper\AssetsStream
::
basePath
();
if
(
$public_stream
!==
$assets_stream
)
{
$stream_wrappers
.
=
"|(
$assets_stream
)"
;
}
}
// phpcs:enable
$pattern
=
"@
$stream_wrappers
|(/system/files/styles/)|(/history/\d+/read)|(/contextual/render)|(/media/oembed)@"
;
if
(
preg_match
(
$pattern
,
$request
->
getRequestUri
()))
{
return
FALSE
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment