Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dns-over-https
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
m13253
dns-over-https
Commits
34014d84
Unverified
Commit
34014d84
authored
2 years ago
by
Star Brilliant
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #137 from Gontier-Julien/patch
Removing Firefox 61-62 workaround patch
parents
71eecf7b
1fff6290
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doh-server/ietf.go
+1
-17
1 addition, 17 deletions
doh-server/ietf.go
with
1 addition
and
17 deletions
doh-server/ietf.go
+
1
−
17
View file @
34014d84
...
...
@@ -182,8 +182,6 @@ func (s *Server) generateResponseIETF(ctx context.Context, w http.ResponseWriter
w
.
Header
()
.
Set
(
"Last-Modified"
,
now
)
w
.
Header
()
.
Set
(
"Vary"
,
"Accept"
)
_
=
s
.
patchFirefoxContentType
(
w
,
r
,
req
)
if
respJSON
.
HaveTTL
{
if
req
.
isTailored
{
w
.
Header
()
.
Set
(
"Cache-Control"
,
"private, max-age="
+
strconv
.
FormatUint
(
uint64
(
respJSON
.
LeastTTL
),
10
))
...
...
@@ -218,17 +216,3 @@ func (s *Server) patchDNSCryptProxyReqID(w http.ResponseWriter, r *http.Request,
}
return
false
}
\ No newline at end of file
// Workaround a bug causing Firefox 61-62 to reject responses with Content-Type = application/dns-message
func
(
s
*
Server
)
patchFirefoxContentType
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
req
*
DNSRequest
)
bool
{
if
strings
.
Contains
(
r
.
UserAgent
(),
"Firefox"
)
&&
strings
.
Contains
(
r
.
Header
.
Get
(
"Accept"
),
"application/dns-udpwireformat"
)
&&
!
strings
.
Contains
(
r
.
Header
.
Get
(
"Accept"
),
"application/dns-message"
)
{
if
s
.
conf
.
Verbose
{
log
.
Println
(
"Firefox 61-62 detected. Patching response."
)
}
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/dns-udpwireformat"
)
w
.
Header
()
.
Set
(
"Vary"
,
"Accept, User-Agent"
)
req
.
isTailored
=
true
return
true
}
return
false
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment