Skip to content

Commit

Permalink
feat: enable CSRF again
Browse files Browse the repository at this point in the history
  • Loading branch information
eiladin committed Sep 7, 2021
1 parent fa412ae commit a7631ba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ classicBuild: ## Build docker eiladin/go-simple-startpage:$(tag)
docker build -f Dockerfile --build-arg version=$(tag) . -t eiladin/go-simple-startpage:$(tag)

classicPublish: classicBuild ## Push docker eiladin/go-simple-startpage:$(tag) to docker hub with a classic docker build
docker push eiladin/go-simple-startpage:$(tag)
docker push eiladin/go-simple-startpage:$(tag)

test: ## Run unit tests
go test ./... -version

test-coverage: ## Gather code coverage
go test ./... -coverprofile=coverage.out -covermode=atomic
8 changes: 4 additions & 4 deletions internal/server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func getMiddleware(c *config.Config) []echo.MiddlewareFunc {
middleware.CORS(),
middleware.RequestID(),
middleware.Secure(),
// middleware.CSRFWithConfig(middleware.CSRFConfig{
// Skipper: csrfSkipper,
// CookieSecure: true,
// }),
middleware.CSRFWithConfig(middleware.CSRFConfig{
Skipper: csrfSkipper,
CookieSecure: true,
}),
middleware.Recover(),
middleware.GzipWithConfig(middleware.GzipConfig{
Skipper: gzipSkipper,
Expand Down
3 changes: 2 additions & 1 deletion ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ui:build"
"browserTarget": "ui:build",
"disableHostCheck": true
},
"configurations": {
"production": {
Expand Down

0 comments on commit a7631ba

Please sign in to comment.