Fix watch by namespace

This commit is contained in:
derekwaynecarr
2014-10-30 12:55:17 -04:00
parent 78df01172a
commit dda19071e3
3 changed files with 25 additions and 9 deletions

View File

@@ -60,6 +60,10 @@ func isWebsocketRequest(req *http.Request) bool {
// ServeHTTP processes watch requests.
func (h *WatchHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
ctx := api.NewContext()
namespace := req.URL.Query().Get("namespace")
if len(namespace) > 0 {
ctx = api.WithNamespace(ctx, namespace)
}
parts := splitPath(req.URL.Path)
if len(parts) < 1 || req.Method != "GET" {
notFound(w, req)