@@ -1,6 +1,7 @@
package data
import (
+ "strings"
"time"
"github.com/google/btree"
@@ -72,3 +73,14 @@ func (a *RequestData) ToRequest() *Request {
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
+}