You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@htrace.apache.org by cm...@apache.org on 2015/01/04 20:55:07 UTC

incubator-htrace git commit: HTRACE-37. htraced: serve index.html if the root URL was given (cmccabe)

Repository: incubator-htrace
Updated Branches:
  refs/heads/master 16fc1bf75 -> d1c65bf89


HTRACE-37. htraced: serve index.html if the root URL was given (cmccabe)


Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/d1c65bf8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/d1c65bf8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/d1c65bf8

Branch: refs/heads/master
Commit: d1c65bf89585f9b15c3cb3a66ac4a4d43e219827
Parents: 16fc1bf
Author: Colin P. Mccabe <cm...@apache.org>
Authored: Sun Jan 4 11:54:37 2015 -0800
Committer: Colin P. Mccabe <cm...@apache.org>
Committed: Sun Jan 4 11:54:37 2015 -0800

----------------------------------------------------------------------
 htrace-core/src/go/src/org/apache/htrace/htraced/rest.go | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/d1c65bf8/htrace-core/src/go/src/org/apache/htrace/htraced/rest.go
----------------------------------------------------------------------
diff --git a/htrace-core/src/go/src/org/apache/htrace/htraced/rest.go b/htrace-core/src/go/src/org/apache/htrace/htraced/rest.go
index 61f4a02..ae28f8d 100644
--- a/htrace-core/src/go/src/org/apache/htrace/htraced/rest.go
+++ b/htrace-core/src/go/src/org/apache/htrace/htraced/rest.go
@@ -133,6 +133,9 @@ type defaultServeHandler struct {
 
 func (hand *defaultServeHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
 	ident := strings.TrimLeft(req.URL.Path, "/")
+	if ident == "" {
+		ident = "index.html" // default to index.html
+	}
 	ident = strings.Replace(ident, "/", "__", -1)
 	rsc := resource.Catalog[ident]
 	if rsc == "" {