mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
handle serve raw case
This commit is contained in:
parent
8dac935cd8
commit
40478215d0
4 changed files with 56 additions and 43 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue