mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
@@ -88,6 +88,9 @@ type HTTP struct {
|
||||
|
||||
// HTTP methods to allow.
|
||||
Methods Whitelist `json:"methods"`
|
||||
|
||||
// Media types where the Content-Type in the response is used instead of resolving from the file content.
|
||||
MediaTypes Whitelist `json:"mediaTypes"`
|
||||
}
|
||||
|
||||
// ToTOML converts c to TOML with [security] as the root.
|
||||
|
@@ -163,8 +163,10 @@ func TestDecodeConfigDefault(t *testing.T) {
|
||||
c.Assert(pc.HTTP.Methods.Accept("GET"), qt.IsTrue)
|
||||
c.Assert(pc.HTTP.Methods.Accept("get"), qt.IsTrue)
|
||||
c.Assert(pc.HTTP.Methods.Accept("DELETE"), qt.IsFalse)
|
||||
c.Assert(pc.HTTP.MediaTypes.Accept("application/msword"), qt.IsFalse)
|
||||
|
||||
c.Assert(pc.Exec.OsEnv.Accept("PATH"), qt.IsTrue)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("GOROOT"), qt.IsTrue)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("MYSECRET"), qt.IsFalse)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user