Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miniflux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
TeDomum
miniflux
Commits
09be3d2b
Commit
09be3d2b
authored
3 years ago
by
Frédéric Guillot
Committed by
fguillot
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove invalid CSRF HTML meta tag
parent
1fd4c4ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
template/functions.go
+2
-2
2 additions, 2 deletions
template/functions.go
template/templates/common/layout.html
+3
-6
3 additions, 6 deletions
template/templates/common/layout.html
ui/static/js/request_builder.js
+2
-2
2 additions, 2 deletions
ui/static/js/request_builder.js
with
7 additions
and
10 deletions
template/functions.go
+
2
−
2
View file @
09be3d2b
...
...
@@ -75,7 +75,7 @@ func (f *funcMap) Map() template.FuncMap {
"contains"
:
func
(
str
,
substr
string
)
bool
{
return
strings
.
Contains
(
str
,
substr
)
},
"replace"
:
func
(
str
,
old
string
,
new
string
)
string
{
"replace"
:
func
(
str
,
old
,
new
string
)
string
{
return
strings
.
Replace
(
str
,
old
,
new
,
1
)
},
"isodate"
:
func
(
ts
time
.
Time
)
string
{
...
...
@@ -86,7 +86,7 @@ func (f *funcMap) Map() template.FuncMap {
},
"icon"
:
func
(
iconName
string
)
template
.
HTML
{
return
template
.
HTML
(
fmt
.
Sprintf
(
`<svg class="icon" aria-hidden="true"><use xlink:href="%s#icon-%s"></svg>`
,
`<svg class="icon" aria-hidden="true"><use xlink:href="%s#icon-%s"
/
></svg>`
,
route
.
Path
(
f
.
router
,
"appIcon"
,
"filename"
,
"sprite.svg"
),
iconName
,
))
...
...
This diff is collapsed.
Click to expand it.
template/templates/common/layout.html
+
3
−
6
View file @
09be3d2b
...
...
@@ -29,20 +29,17 @@
<link
rel=
"apple-touch-icon"
sizes=
"167x167"
href=
"{{ route "
appIcon
"
"
filename
"
"
icon-167.png
"
}}"
>
<link
rel=
"apple-touch-icon"
sizes=
"180x180"
href=
"{{ route "
appIcon
"
"
filename
"
"
icon-180.png
"
}}"
>
{{ if .csrf }}
<meta
name=
"X-CSRF-Token"
value=
"{{ .csrf }}"
>
{{ end }}
<meta
name=
"theme-color"
content=
"{{ theme_color .theme }}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ route "
stylesheet
"
"
name
"
.
theme
}}?{{
.
theme_checksum
}}"
>
{{ if and .user .user.Stylesheet }}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ route "
stylesheet
"
"
name
"
"
custom_css
"
}}?{{
rand
}}"
>
{{ end }}
<script
type=
"text/javascript"
src=
"{{ route "
javascript
"
"
name
"
"
app
"
}}?{{
.
app_js_checksum
}}"
defer
></script>
<script
type=
"text/javascript"
src=
"{{ route "
javascript
"
"
name
"
"
service-worker
"
}}?{{
.
sw_js_checksum
}}"
defer
id=
"service-worker-script"
></script>
<script
src=
"{{ route "
javascript
"
"
name
"
"
app
"
}}?{{
.
app_js_checksum
}}"
defer
></script>
<script
src=
"{{ route "
javascript
"
"
name
"
"
service-worker
"
}}?{{
.
sw_js_checksum
}}"
defer
id=
"service-worker-script"
></script>
</head>
<body
{{
if
.
csrf
}}
data-csrf-token=
"{{ .csrf }}"
{{
end
}}
data-entries-status-url=
"{{ route "
updateEntriesStatus
"
}}"
data-refresh-all-feeds-url=
"{{ route "
refreshAllFeeds
"
}}"
{{
if
.
user
}}{{
if
not
.
user.KeyboardShortcuts
}}
data-disable-keyboard-shortcuts=
"true"
{{
end
}}{{
end
}}
>
...
...
This diff is collapsed.
Click to expand it.
ui/static/js/request_builder.js
+
2
−
2
View file @
09be3d2b
...
...
@@ -30,9 +30,9 @@ class RequestBuilder {
}
getCsrfToken
()
{
let
element
=
document
.
querySelector
(
"
meta[name=X-CSRF-T
oken
]
"
);
let
element
=
document
.
querySelector
(
"
body[data-csrf-t
oken
"
);
if
(
element
!==
null
)
{
return
element
.
getAttribute
(
"
value
"
)
;
return
element
.
dataset
.
csrfToken
;
}
return
""
;
...
...
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