3 Commits

Author SHA1 Message Date
Bel LaPointe
dee04b6962 ewwww broke passthrough basic auth 2024-04-01 06:45:31 -06:00
Bel LaPointe
87d95b4eff Merge branch 'master' of https://gitea.inhome.blapointe.com/local/rproxy3 2024-04-01 06:44:15 -06:00
Bel LaPointe
669f3283f4 from gogs 2024-01-09 08:05:16 -07:00
5 changed files with 20 additions and 1 deletions

View File

@@ -9,6 +9,9 @@ import (
"gitea.inhome.blapointe.com/local/args"
"gitea.inhome.blapointe.com/local/logb"
"gitea.inhome.blapointe.com/local/args"
"gitea.inhome.blapointe.com/local/logb"
)
var conf *args.ArgSet

6
go.mod
View File

@@ -7,6 +7,12 @@ require (
gitea.inhome.blapointe.com/local/logb v0.0.0-20231109150430-1221d87a6dbc
gitea.inhome.blapointe.com/local/oauth2 v0.0.0-20240109220403-8897142866f1
github.com/google/uuid v1.3.0
<<<<<<< HEAD
gitea.inhome.blapointe.com/local/args v0.0.0-20230410154220-44370f257b34
gitea.inhome.blapointe.com/local/logb v0.0.0-20230410154319-880efa39d871
gitea.inhome.blapointe.com/local/oauth2 v0.0.0-20230410162733-d39498ff8454
=======
>>>>>>> f083763f1d7e0fd450f167db58f091310c8b2ec2
golang.org/x/time v0.1.0
)

View File

@@ -12,6 +12,9 @@ import (
"gitea.inhome.blapointe.com/local/rproxy3/config"
"gitea.inhome.blapointe.com/local/rproxy3/storage/packable"
"gitea.inhome.blapointe.com/local/rproxy3/config"
"gitea.inhome.blapointe.com/local/rproxy3/storage/packable"
)
type redirPurge struct {

View File

@@ -20,6 +20,10 @@ import (
"gitea.inhome.blapointe.com/local/rproxy3/storage"
"gitea.inhome.blapointe.com/local/rproxy3/storage/packable"
"gitea.inhome.blapointe.com/local/rproxy3/config"
"gitea.inhome.blapointe.com/local/rproxy3/storage"
"gitea.inhome.blapointe.com/local/rproxy3/storage/packable"
"github.com/google/uuid"
"golang.org/x/time/rate"
)
@@ -154,7 +158,7 @@ func (s *Server) Pre(foo http.HandlerFunc) http.HandlerFunc {
log.Printf("failed to lookup auth for %s (%s): %v", r.Host, mapKey(r.Host), err)
w.Header().Set("WWW-Authenticate", "Basic")
http.Error(w, err.Error(), http.StatusUnauthorized)
} else if _, p, _ := r.BasicAuth(); auth != p {
} else if _, p, _ := r.BasicAuth(); auth != "" && auth != p {
log.Printf("failed to auth: expected %q but got %q", auth, p)
w.Header().Set("WWW-Authenticate", "Basic")
http.Error(w, "unexpected basic auth", http.StatusUnauthorized)

View File

@@ -11,6 +11,9 @@ import (
"gitea.inhome.blapointe.com/local/rproxy3/config"
"gitea.inhome.blapointe.com/local/rproxy3/storage"
"gitea.inhome.blapointe.com/local/rproxy3/config"
"gitea.inhome.blapointe.com/local/rproxy3/storage"
"golang.org/x/time/rate"
)