Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
fc3b4b84
Unverified
Commit
fc3b4b84
authored
3 years ago
by
xgui3783
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge branch 'staging' into hotfix_vipRoutes
parents
b877dc54
a60af43d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
deploy/saneUrl/index.js
+18
-8
18 additions, 8 deletions
deploy/saneUrl/index.js
docs/releases/v2.6.5.md
+4
-0
4 additions, 0 deletions
docs/releases/v2.6.5.md
with
22 additions
and
8 deletions
deploy/saneUrl/index.js
+
18
−
8
View file @
fc3b4b84
...
...
@@ -4,7 +4,7 @@ const { GitlabSnippetStore: Store, NotFoundError } = require('./store')
const
{
Store
:
DepcStore
}
=
require
(
'
./depcObjStore
'
)
const
RateLimit
=
require
(
'
express-rate-limit
'
)
const
RedisStore
=
require
(
'
rate-limit-redis
'
)
const
{
redisURL
}
=
require
(
'
../lruStore
'
)
const
lruStore
=
require
(
'
../lruStore
'
)
const
{
ProxyStore
,
NotExactlyPromiseAny
}
=
require
(
'
./util
'
)
let
store
...
...
@@ -23,12 +23,22 @@ const {
DISABLE_LIMITER
,
}
=
process
.
env
const
limiter
=
new
RateLimit
({
windowMs
:
1
e3
*
5
,
max
:
5
,
...(
redisURL
?
{
store
:
new
RedisStore
({
redisURL
})
}
:
{}
)
})
const
passthrough
=
(
_
,
__
,
next
)
=>
next
()
function
limiterMiddleware
(){
let
limiter
return
async
(
req
,
res
,
next
)
=>
{
if
(
DISABLE_LIMITER
)
return
next
()
if
(
limiter
)
return
limiter
(
req
,
res
,
next
)
await
lruStore
.
_initPr
const
{
redisURL
}
=
lruStore
limiter
=
new
RateLimit
({
windowMs
:
1
e3
*
5
,
max
:
5
,
store
:
redisURL
?
new
RedisStore
({
redisURL
})
:
null
})
return
limiter
(
req
,
res
,
next
)
}
}
const
acceptHtmlProg
=
/text
\/
html/i
...
...
@@ -85,7 +95,7 @@ router.get('/:name', async (req, res) => {
})
router
.
post
(
'
/:name
'
,
DISABLE_LIMITER
?
passthrough
:
limiter
,
limiterMiddleware
()
,
express
.
json
(),
async
(
req
,
res
)
=>
{
if
(
req
.
headers
[
'
x-noop
'
])
return
res
.
status
(
200
).
end
()
...
...
This diff is collapsed.
Click to expand it.
docs/releases/v2.6.5.md
+
4
−
0
View file @
fc3b4b84
...
...
@@ -5,3 +5,7 @@
-
Re-enabled autoradiographs for receptor datasets
-
Added how-to-cite as a part of quick tour (#1085)
-
Added VIP routes
## Bugfix
-
saneUrl store now properly uses redis
This diff is collapsed.
Click to expand it.
Preview
0%
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