Skip to content

Commit

Permalink
Pull request: 2835 fix mobileconfig
Browse files Browse the repository at this point in the history
Merge in DNS/adguard-home from 2835-fix-mobileconfig to master

Updates #2835.

Squashed commit of the following:

commit 83a6fd0
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Wed Mar 17 13:37:14 2021 +0300

    all: imp changes' log

commit 3dabf02
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Wed Mar 17 13:31:36 2021 +0300

    all: imp naming, log changes

commit c87032f
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Wed Mar 17 13:22:19 2021 +0300

    home: fix mobileconfig response
  • Loading branch information
EugeneOne1 committed Mar 17, 2021
1 parent 67164f8 commit 3701c3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ and this project adheres to

- Go 1.14 support.

### Fixed

- Invalid filenames in the `mobileconfig` API responses ([#2835]).

[#2385]: https://github.com/AdguardTeam/AdGuardHome/issues/2385
[#2412]: https://github.com/AdguardTeam/AdGuardHome/issues/2412
[#2498]: https://github.com/AdguardTeam/AdGuardHome/issues/2498
[#2533]: https://github.com/AdguardTeam/AdGuardHome/issues/2533
[#2835]: https://github.com/AdguardTeam/AdGuardHome/issues/2835



Expand Down
12 changes: 12 additions & 0 deletions internal/home/mobileconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ func handleMobileConfig(w http.ResponseWriter, r *http.Request, dnsp string) {

w.Header().Set("Content-Type", "application/xml")

const (
dohContDisp = `attachment; filename=doh.mobileconfig`
dotContDisp = `attachment; filename=dot.mobileconfig`
)

contDisp := dohContDisp
if dnsp == dnsProtoTLS {
contDisp = dotContDisp
}

w.Header().Set("Content-Disposition", contDisp)

_, _ = w.Write(mobileconfig)
}

Expand Down

0 comments on commit 3701c3f

Please sign in to comment.