|
@@ -1,6 +1,7 @@
|
|
package data
|
|
package data
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "strings"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
"github.com/google/btree"
|
|
"github.com/google/btree"
|
|
@@ -72,3 +73,14 @@ func (a *RequestData) ToRequest() *Request {
|
|
Via: a.Via,
|
|
Via: a.Via,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// Path returns the Url without any query string
|
|
|
|
+func (a *RequestData) Path() string {
|
|
|
|
+ idx := strings.Index(a.Url, "?")
|
|
|
|
+
|
|
|
|
+ if idx >= 0 {
|
|
|
|
+ return a.Url[0:idx]
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return a.Url
|
|
|
|
+}
|