modify redirect test to include port
Signed-off-by: Andrew Hsu <andrewhsu@acm.org> (github: andrewhsu)
This commit is contained in:
parent
fba2e3a206
commit
3336cc13e4
1 changed files with 4 additions and 4 deletions
|
@ -24,20 +24,20 @@ func (s *MiddlewareSuite) TestMissingScheme(c *check.C) {
|
|||
c.Assert(err, check.ErrorMatches, "no scheme specified for redirect baseurl")
|
||||
}
|
||||
|
||||
func (s *MiddlewareSuite) TestHTTPS(c *check.C) {
|
||||
func (s *MiddlewareSuite) TestHttpsPort(c *check.C) {
|
||||
options := make(map[string]interface{})
|
||||
options["baseurl"] = "https://example.com"
|
||||
options["baseurl"] = "https://example.com:5443"
|
||||
middleware, err := newRedirectStorageMiddleware(nil, options)
|
||||
c.Assert(err, check.Equals, nil)
|
||||
|
||||
m, ok := middleware.(*redirectStorageMiddleware)
|
||||
c.Assert(ok, check.Equals, true)
|
||||
c.Assert(m.scheme, check.Equals, "https")
|
||||
c.Assert(m.host, check.Equals, "example.com")
|
||||
c.Assert(m.host, check.Equals, "example.com:5443")
|
||||
|
||||
url, err := middleware.URLFor(nil, "/rick/data", nil)
|
||||
c.Assert(err, check.Equals, nil)
|
||||
c.Assert(url, check.Equals, "https://example.com/rick/data")
|
||||
c.Assert(url, check.Equals, "https://example.com:5443/rick/data")
|
||||
}
|
||||
|
||||
func (s *MiddlewareSuite) TestHTTP(c *check.C) {
|
||||
|
|
Loading…
Reference in a new issue