Commit c7af6725 authored by Matthew Holt's avatar Matthew Holt

Removed Host() and Port() functions from Controller

I don't think they'll be necessary; can get same info from request Host header
parent feec7c5b
......@@ -42,16 +42,6 @@ func (c *controller) Root() string {
}
}
// Host returns the hostname the server is bound to.
func (c *controller) Host() string {
return c.parser.cfg.Host
}
// Port returns the port that the server is listening on.
func (c *controller) Port() string {
return c.parser.cfg.Port
}
// Context returns the path scope that the Controller is in.
func (c *controller) Context() middleware.Path {
return middleware.Path(c.pathScope)
......
......@@ -30,16 +30,6 @@ func TestController(t *testing.T) {
t.Errorf("Expected established root path to be '%s', got '%s'", c.parser.cfg.Root, root)
}
c.parser.cfg.Host = "localhost"
if host := c.Host(); host != c.parser.cfg.Host {
t.Errorf("Expected host to be '%s', got '%s'", c.parser.cfg.Host, host)
}
c.parser.cfg.Port = "1234"
if port := c.Port(); port != c.parser.cfg.Port {
t.Errorf("Expected port to be '%s', got '%s'", c.parser.cfg.Port, port)
}
c.pathScope = "unused"
if context := c.Context(); string(context) != c.pathScope {
t.Errorf("Expected context to be '%s', got '%s'", c.pathScope, context)
......
......@@ -59,12 +59,6 @@ type (
// Root returns the file path from which the server is serving.
Root() string
// Host returns the hostname the server is bound to.
Host() string
// Port returns the port that the server is listening on.
Port() string
// Context returns the path scope that the Controller is in.
// Note: This is not currently used, but may be in the future.
Context() Path
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment