Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
imghost
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
imghost
Compare revisions
321e8fbd16a8214e712ef8c03a6abdebf035fd1e to a0a6a35aadb91054df8fccf25cb641e9c8365b95
Project 'justJanne/imghost-frontend' was moved to 'justJanne/imghost'. Please update any links and bookmarks that may still have the old path.
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
justJanne/imghost
Select target project
No results found
a0a6a35aadb91054df8fccf25cb641e9c8365b95
Select Git revision
Branches
main
ui-rewrite
2 results
Swap
Target
justJanne/imghost
Select target project
justJanne/imghost
1 result
321e8fbd16a8214e712ef8c03a6abdebf035fd1e
Select Git revision
Branches
main
ui-rewrite
2 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Ignore File Extensions for Images
· 730df3d6
Janne Mareike Koschinski
authored
6 years ago
Verified
730df3d6
Updated node dependencies
· a0a6a35a
Janne Mareike Koschinski
authored
6 years ago
Verified
a0a6a35a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
package.json
+1
-1
1 addition, 1 deletion
package.json
page_index.go
+11
-0
11 additions, 0 deletions
page_index.go
with
12 additions
and
1 deletion
package.json
View file @
a0a6a35a
...
@@ -4,6 +4,6 @@
...
@@ -4,6 +4,6 @@
"build"
:
"npm run sass"
"build"
:
"npm run sass"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
node-sass
"
:
"
^4.
7.2
"
"
node-sass
"
:
"
^4.
10.0
"
}
}
}
}
This diff is collapsed.
Click to expand it.
page_index.go
View file @
a0a6a35a
...
@@ -2,12 +2,22 @@ package main
...
@@ -2,12 +2,22 @@ package main
import
(
import
(
"net/http"
"net/http"
"strings"
)
)
type
IndexData
struct
{
type
IndexData
struct
{
User
UserInfo
User
UserInfo
}
}
func
removeFileExtensions
(
path
string
)
string
{
var
i
=
strings
.
IndexByte
(
path
,
'.'
)
if
i
<
0
{
return
path
}
else
{
return
path
[
0
:
i
]
}
}
func
pageIndex
(
ctx
PageContext
)
http
.
Handler
{
func
pageIndex
(
ctx
PageContext
)
http
.
Handler
{
return
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
return
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
if
r
.
URL
.
Path
==
"/"
{
if
r
.
URL
.
Path
==
"/"
{
...
@@ -33,6 +43,7 @@ func pageIndex(ctx PageContext) http.Handler {
...
@@ -33,6 +43,7 @@ func pageIndex(ctx PageContext) http.Handler {
}
else
{
}
else
{
w
.
Header
()
.
Set
(
"Vary"
,
"Accept-Encoding"
)
w
.
Header
()
.
Set
(
"Vary"
,
"Accept-Encoding"
)
w
.
Header
()
.
Set
(
"Cache-Control"
,
"public, max-age=31536000"
)
w
.
Header
()
.
Set
(
"Cache-Control"
,
"public, max-age=31536000"
)
r
.
URL
.
Path
=
removeFileExtensions
(
r
.
URL
.
Path
)
ctx
.
Images
.
ServeHTTP
(
w
,
r
)
ctx
.
Images
.
ServeHTTP
(
w
,
r
)
}
}
})
})
...
...
This diff is collapsed.
Click to expand it.