Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hashworksNET
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hashworks
hashworksNET
Compare Revisions
7e24b6a21ac0a9cf1ecbf0b70a940bb8dc0dc0a3...a1b3585262f2032d606449d7d3e1057a167d4bc3
Source
a1b3585262f2032d606449d7d3e1057a167d4bc3
Select Git revision
...
Target
7e24b6a21ac0a9cf1ecbf0b70a940bb8dc0dc0a3
Select Git revision
Compare
Commits (2)
More go import reorderings
· 1636e08d
hashworks
authored
Oct 30, 2019
1636e08d
Update unit tests
· a1b35852
hashworks
authored
Oct 30, 2019
a1b35852
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
11 deletions
+15
-11
server/handlerIndex.go
server/handlerIndex.go
+2
-1
server/security.go
server/security.go
+3
-2
server/server_test.go
server/server_test.go
+6
-5
server/specialHandlers.go
server/specialHandlers.go
+4
-3
No files found.
server/handlerIndex.go
View file @
a1b35852
package
server
import
(
"github.com/gin-gonic/gin"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
func
(
s
Server
)
handlerIndex
(
c
*
gin
.
Context
)
{
...
...
server/security.go
View file @
a1b35852
...
...
@@ -2,10 +2,11 @@ package server
import
(
"fmt"
"github.com/gin-gonic/gin"
"github.com/unrolled/secure"
"net/http"
"strings"
"github.com/gin-gonic/gin"
"github.com/unrolled/secure"
)
func
(
s
Server
)
getSecureMiddleware
()
*
secure
.
Secure
{
...
...
server/server_test.go
View file @
a1b35852
...
...
@@ -2,14 +2,15 @@ package server
import
(
"fmt"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"net"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
)
var
influxAddressLoadData
,
...
...
@@ -290,9 +291,9 @@ func (s *Server) headerTest(t *testing.T) {
s
.
Router
.
ServeHTTP
(
w
,
req
)
assert
.
Equal
(
t
,
200
,
w
.
Code
)
assert
.
True
(
t
,
strings
.
Contains
(
w
.
Body
.
String
(),
fmt
.
Sprintf
(
`<style rel=
"stylesheet"
type="text/css">%s</style>`
,
s
.
css
)))
assert
.
True
(
t
,
strings
.
Contains
(
w
.
Body
.
String
(),
fmt
.
Sprintf
(
`<style rel=
stylesheet
type="text/css">%s</style>`
,
s
.
css
)))
if
path
==
"/status"
{
assert
.
True
(
t
,
strings
.
Contains
(
w
.
Body
.
String
(),
`<link rel=
"stylesheet"
type="text/css" href="/css/status.css">`
))
assert
.
True
(
t
,
strings
.
Contains
(
w
.
Body
.
String
(),
`<link rel=
stylesheet
type="text/css" href="/css/status.css">`
))
}
}
}
...
...
@@ -552,7 +553,7 @@ func TestNoDebugCSS(t *testing.T) {
assert
.
Equal
(
t
,
http
.
StatusOK
,
w
.
Code
)
assert
.
Contains
(
t
,
w
.
Body
.
String
(),
"mail@hashworks.net"
)
assert
.
True
(
t
,
strings
.
Contains
(
w
.
Body
.
String
(),
fmt
.
Sprintf
(
"<style rel=
\"
stylesheet
\"
type=
\"
text/css
\"
>%s</style>"
,
s
.
css
)))
assert
.
True
(
t
,
strings
.
Contains
(
w
.
Body
.
String
(),
fmt
.
Sprintf
(
"<style rel=
stylesheet
type=
\"
text/css
\"
>%s</style>"
,
s
.
css
)))
}
func
TestConfigError
(
t
*
testing
.
T
)
{
...
...
server/specialHandlers.go
View file @
a1b35852
package
server
import
(
"github.com/gin-contrib/cache"
"github.com/gin-contrib/cache/persistence"
"github.com/gin-gonic/gin"
"log"
"net/http"
"strings"
"time"
"github.com/gin-contrib/cache"
"github.com/gin-contrib/cache/persistence"
"github.com/gin-gonic/gin"
)
func
(
s
Server
)
recoveryHandlerStatus
(
statusCode
int
,
c
*
gin
.
Context
,
err
interface
{})
{
...
...