Update tests and additional fixups.

This commit is contained in:
2024-11-06 11:32:35 +00:00
parent 66e08755c1
commit 7a53da6080
77 changed files with 745 additions and 30421 deletions
+12 -1
View File
@@ -6,6 +6,8 @@ import (
"log"
"net/http"
"os"
"github.com/gorilla/sessions"
)
const (
@@ -26,6 +28,15 @@ type Config struct {
RateLimit int `json:"rateLimit"`
ExcludedURLs []string `json:"excludedURLs"`
AllowedUserDomains []string `json:"allowedUserDomains"`
HTTPClient *http.Client
}
var defaultSessionOptions = &sessions.Options{
HttpOnly: true,
Secure: false,
SameSite: http.SameSiteLaxMode,
MaxAge: ConstSessionTimeout,
Path: "/",
}
func CreateConfig() *Config {
@@ -119,6 +130,6 @@ func (l *Logger) Errorf(format string, args ...interface{}) {
}
func handleError(w http.ResponseWriter, message string, code int, logger *Logger) {
logger.Errorf(message)
logger.Error(message)
http.Error(w, message, code)
}