handle serve raw case

This commit is contained in:
6543 2022-09-18 21:56:56 +02:00
parent 8dac935cd8
commit 40478215d0
No known key found for this signature in database
GPG key ID: B8BE6D610E61C862
4 changed files with 56 additions and 43 deletions

View file

@ -134,11 +134,7 @@ func Handler(mainDomainSuffix, rawDomain string,
log.Debug().Msg("raw domain")
targetOptions.TryIndexPages = false
if targetOptions.ForbiddenMimeTypes == nil {
targetOptions.ForbiddenMimeTypes = make(map[string]bool)
}
targetOptions.ForbiddenMimeTypes["text/html"] = true
targetOptions.DefaultMimeType = "text/plain; charset=utf-8"
targetOptions.ServeRaw = true
pathElements := strings.Split(strings.Trim(ctx.Path(), "/"), "/")
if len(pathElements) < 2 {