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
622aca90
Commit
622aca90
authored
2 years ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
fix saneurl
parent
8798cc16
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/releases/v2.7.3.md
+1
-0
1 addition, 0 deletions
docs/releases/v2.7.3.md
e2e/checklist.md
+3
-0
3 additions, 0 deletions
e2e/checklist.md
src/share/saneUrl/saneUrl.service.ts
+9
-4
9 additions, 4 deletions
src/share/saneUrl/saneUrl.service.ts
src/util/priority.ts
+7
-2
7 additions, 2 deletions
src/util/priority.ts
with
20 additions
and
6 deletions
docs/releases/v2.7.3.md
+
1
−
0
View file @
622aca90
...
...
@@ -3,6 +3,7 @@
## Bugfix
-
fixed matomo visitor counting (broke since 2.7.0 release)
-
fixed sane url generation
## Under the hood
...
...
This diff is collapsed.
Click to expand it.
e2e/checklist.md
+
3
−
0
View file @
622aca90
...
...
@@ -65,6 +65,9 @@
-
[ ] on hover, show correct region name(s)
-
[ ] whole mesh loads
## saneURL
-
[ ] saneurl generation functions properly
-
[ ] try existing key (human), and get unavailable error
-
[ ] try non existing key, and get available
-
[
] [saneUrl
](
https://atlases.ebrains.eu/viewer-staging/saneUrl/bigbrainGreyWhite
)
redirects to big brain
-
[
] [saneUrl
](
https://atlases.ebrains.eu/viewer-staging/saneUrl/julichbrain
)
redirects to julich brain (colin 27)
-
[
] [saneUrl
](
https://atlases.ebrains.eu/viewer-staging/saneUrl/whs4
)
redirects to waxholm v4
...
...
This diff is collapsed.
Click to expand it.
src/share/saneUrl/saneUrl.service.ts
+
9
−
4
View file @
622aca90
...
...
@@ -4,23 +4,27 @@ import { throwError } from "rxjs";
import
{
catchError
,
mapTo
}
from
"
rxjs/operators
"
;
import
{
BACKENDURL
}
from
'
src/util/constants
'
import
{
IKeyValStore
,
NotFoundError
}
from
'
../type
'
import
{
DISABLE_PRIORITY_HEADER
}
from
"
src/util/priority
"
@
Injectable
({
providedIn
:
'
root
'
})
export
class
SaneUrlSvc
implements
IKeyValStore
{
public
saneUrlRoot
=
`
${
BACKENDURL
}
saneUrl
/`
public
saneUrlRoot
=
`
${
BACKENDURL
}
go
/`
constructor
(
private
http
:
HttpClient
){
if
(
!
BACKENDURL
)
{
const
loc
=
window
.
location
this
.
saneUrlRoot
=
`
${
loc
.
protocol
}
//
${
loc
.
hostname
}${
!!
loc
.
port
?
(
'
:
'
+
loc
.
port
)
:
''
}${
loc
.
pathname
}
go/`
}
}
getKeyVal
(
key
:
string
)
{
return
this
.
http
.
get
<
Record
<
string
,
any
>>
(
`
${
this
.
saneUrlRoot
}${
key
}
`
,
{
responseType
:
'
json
'
}
{
responseType
:
'
json
'
,
headers
:
{
[
DISABLE_PRIORITY_HEADER
]:
'
1
'
}
}
).
pipe
(
catchError
((
err
,
obs
)
=>
{
const
{
status
}
=
err
...
...
@@ -35,7 +39,8 @@ export class SaneUrlSvc implements IKeyValStore{
setKeyVal
(
key
:
string
,
value
:
any
)
{
return
this
.
http
.
post
(
`
${
this
.
saneUrlRoot
}${
key
}
`
,
value
value
,
{
headers
:
{
[
DISABLE_PRIORITY_HEADER
]:
'
1
'
}
}
).
pipe
(
mapTo
(
`
${
this
.
saneUrlRoot
}${
key
}
`
)
)
...
...
This diff is collapsed.
Click to expand it.
src/util/priority.ts
+
7
−
2
View file @
622aca90
...
...
@@ -24,6 +24,8 @@ type Queue = {
next
:
HttpHandler
}
export
const
DISABLE_PRIORITY_HEADER
=
'
x-sxplr-disable-priority
'
@
Injectable
({
providedIn
:
'
root
'
})
...
...
@@ -137,8 +139,11 @@ export class PriorityHttpInterceptor implements HttpInterceptor{
* Since the way in which serialization occurs is via path and query param...
* body is not used.
*/
if
(
this
.
disablePriority
||
req
.
method
!==
'
GET
'
)
{
return
next
.
handle
(
req
)
if
(
this
.
disablePriority
||
req
.
method
!==
'
GET
'
||
!!
req
.
headers
.
get
(
DISABLE_PRIORITY_HEADER
))
{
const
newReq
=
req
.
clone
({
headers
:
req
.
headers
.
delete
(
DISABLE_PRIORITY_HEADER
)
})
return
next
.
handle
(
newReq
)
}
const
{
urlWithParams
}
=
req
...
...
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