2021-12-05 13:47:33 +00:00
|
|
|
package upstream
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
// upstreamIndexPages lists pages that may be considered as index pages for directories.
|
|
|
|
var upstreamIndexPages = []string{
|
|
|
|
"index.html",
|
|
|
|
}
|
|
|
|
|
2022-06-12 01:50:00 +00:00
|
|
|
// upstreamNotFoundPages lists pages that may be considered as custom 404 Not Found pages.
|
|
|
|
var upstreamNotFoundPages = []string{
|
|
|
|
"404.html",
|
|
|
|
}
|
|
|
|
|
2021-12-05 13:47:33 +00:00
|
|
|
// Options provides various options for the upstream request.
|
|
|
|
type Options struct {
|
2021-12-05 18:53:23 +00:00
|
|
|
TargetOwner,
|
|
|
|
TargetRepo,
|
|
|
|
TargetBranch,
|
|
|
|
TargetPath,
|
|
|
|
|
|
|
|
DefaultMimeType string
|
2022-06-11 21:02:06 +00:00
|
|
|
ForbiddenMimeTypes map[string]bool
|
2021-12-05 16:57:54 +00:00
|
|
|
TryIndexPages bool
|
|
|
|
BranchTimestamp time.Time
|
|
|
|
// internal
|
|
|
|
appendTrailingSlash bool
|
|
|
|
redirectIfExists string
|
2021-12-05 13:47:33 +00:00
|
|
|
}
|