oknow ctx bad

main
Bel LaPointe 2024-02-20 08:00:45 -07:00
parent f958dcacc4
commit 9be5d8235e
1 changed files with 5 additions and 1 deletions

View File

@ -66,6 +66,10 @@ func (cfg Config) NewHandler() Handler {
}
}
func (s Session) Empty() bool {
return s == (Session{})
}
func runHTTP(ctx context.Context, cfg Config) error {
server := &http.Server{
Addr: cfg.Addr,
@ -105,7 +109,7 @@ func (h Handler) serveHTTP(w http.ResponseWriter, r *http.Request) error {
return h.handle(session, w, r)
}
func (h Handler) auth(r *http.Request) (session, error) {
func (h Handler) auth(r *http.Request) (Session, error) {
user, pass, ok := r.BasicAuth()
if !ok {
return Session{}, nil