Skip to content

Commit

Permalink
Pull request 2202: Fix access error
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 5507401
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Apr 16 17:16:41 2024 +0300

    all: rm replace

commit 983f8d1
Merge: d9fc69d 201ac73
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Apr 16 16:06:28 2024 +0300

    Merge branch 'master' into fix-access-error

commit d9fc69d
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Apr 11 19:18:24 2024 +0300

    all: fix before request, upd golibs
  • Loading branch information
EugeneOne1 committed Apr 16, 2024
1 parent 201ac73 commit 6f7d5cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/AdguardTeam/AdGuardHome
go 1.22.2

require (
github.com/AdguardTeam/dnsproxy v0.69.1
github.com/AdguardTeam/dnsproxy v0.69.2
github.com/AdguardTeam/golibs v0.23.2
github.com/AdguardTeam/urlfilter v0.18.0
github.com/NYTimes/gziphandler v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/AdguardTeam/dnsproxy v0.69.1 h1:KiLkKUSrvHeUO/YEf4Bbo/5zyFRIvQstjL7W9G/24pk=
github.com/AdguardTeam/dnsproxy v0.69.1/go.mod h1:atO3WeeuyepyhjSt6hC+MF7/IN7TZHfG3/ZwhImHzYs=
github.com/AdguardTeam/dnsproxy v0.69.2 h1:/qnjEILMIM7koAIcy+ZB19lb+PSZjJWKjxuGyqVVpp0=
github.com/AdguardTeam/dnsproxy v0.69.2/go.mod h1:zpA9eBxakSyjKC/bUac+UPSYTp/Q43aOmNlBV2/D6ug=
github.com/AdguardTeam/golibs v0.23.2 h1:rMjYantwtQ39e8G4zBQ6ZLlm4s3XH30Bc9VxhoOHwao=
github.com/AdguardTeam/golibs v0.23.2/go.mod h1:o9i55Sx6v7qogRQeqaBfmLbC/pZqeMBWi015U5PTDY0=
github.com/AdguardTeam/urlfilter v0.18.0 h1:ZZzwODC/ADpjJSODxySrrUnt/fvOCfGFaCW6j+wsGfQ=
Expand Down
5 changes: 4 additions & 1 deletion internal/dnsforward/beforerequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ func (s *Server) HandleBefore(
) (err error) {
clientID, err := s.clientIDFromDNSContext(pctx)
if err != nil {
return fmt.Errorf("getting clientid: %w", err)
return &proxy.BeforeRequestError{
Err: fmt.Errorf("getting clientid: %w", err),
Response: s.NewMsgSERVFAIL(pctx.Req),
}
}

blocked, _ := s.IsBlockedClient(pctx.Addr.Addr(), clientID)
Expand Down
2 changes: 1 addition & 1 deletion internal/dnsforward/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (s *Server) handleSetConfig(w http.ResponseWriter, r *http.Request) {
// TODO(e.burkov): Consider prebuilding this set on startup.
ourAddrs, err := s.conf.ourAddrsSet()
if err != nil {
// TODO(e.burkov): Put into openapi
// TODO(e.burkov): Put into openapi.
aghhttp.Error(r, w, http.StatusInternalServerError, "getting our addresses: %s", err)

return
Expand Down

0 comments on commit 6f7d5cc

Please sign in to comment.