Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
server
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
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
m-team
oidc
mytoken
server
Commits
3808b842
Commit
3808b842
authored
3 years ago
by
Gabriel Zachmann
Browse files
Options
Downloads
Patches
Plain Diff
fix 200 status code instead of 404
parent
b6d9676a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
internal/server/errorHandler.go
+1
-1
1 addition, 1 deletion
internal/server/errorHandler.go
internal/server/server.go
+1
-0
1 addition, 0 deletions
internal/server/server.go
with
2 additions
and
1 deletion
internal/server/errorHandler.go
+
1
−
1
View file @
3808b842
...
...
@@ -5,7 +5,6 @@ import (
"github.com/gofiber/fiber/v2"
fiberUtils
"github.com/gofiber/fiber/v2/utils"
"github.com/oidc-mytoken/api/v0"
"github.com/oidc-mytoken/server/internal/model"
)
...
...
@@ -40,6 +39,7 @@ func handleErrorHTML(ctx *fiber.Ctx, code int, msg string) error {
fiber
.
StatusInternalServerError
,
fiber
.
StatusNotImplemented
,
fiber
.
StatusHTTPVersionNotSupported
:
ctx
.
Status
(
code
)
err
=
ctx
.
Render
(
fmt
.
Sprintf
(
"sites/%d"
,
code
),
errorTemplateData
,
"layouts/main"
)
default
:
return
handleErrorJSON
(
ctx
,
code
,
msg
)
...
...
This diff is collapsed.
Click to expand it.
internal/server/server.go
+
1
−
0
View file @
3808b842
...
...
@@ -68,6 +68,7 @@ func Init() {
addRoutes
(
server
)
server
.
Use
(
func
(
ctx
*
fiber
.
Ctx
)
error
{
if
ctx
.
Accepts
(
fiber
.
MIMETextHTML
,
fiber
.
MIMETextHTMLCharsetUTF8
)
!=
""
{
ctx
.
Status
(
fiber
.
StatusNotFound
)
return
ctx
.
Render
(
"sites/404"
,
map
[
string
]
interface
{}{
"empty-navbar"
:
true
,
},
"layouts/main"
)
...
...
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