@@ -20,10 +20,8 @@ const (
2020 // MobileSDKStreamingBasePath is the expected request path for mobile SDK stream requests that
2121 // use the REPORT method, or the base path (not including ClientSideOrMobileUserSubpath) for requests that
2222 // use the GET method.
23- MobileSDKStreamingBasePath = "/meval"
24- // ClientSideOrMobileUserSubpath is a subpath added to client-side/mobile GET requests. The base64-encoded
25- // user data follows this.
26- ClientSideOrMobileUserSubpath = "/user/"
23+ MobileSDKStreamingBasePath = "/meval"
24+ arbitraryPathComponentRegex = "/[^/]*"
2725)
2826
2927// StreamingServiceHandler creates an HTTP handler that provides an SSE stream.
@@ -93,17 +91,17 @@ func ClientSideStreamingServiceHandler(
9391 eventsCh <- chan eventsource.Event ,
9492) (http.Handler , io.Closer ) {
9593 handler , closer := StreamingServiceHandler (initialEvent , eventsCh )
96- return httphelpers .HandlerForPath (
97- ClientSideSDKStreamingBasePath ,
94+ return httphelpers .HandlerForPathRegex (
95+ "^" + ClientSideSDKStreamingBasePath + arbitraryPathComponentRegex + "$" ,
9896 httphelpers .HandlerForMethod ("REPORT" , handler , nil ),
9997 httphelpers .HandlerForPathRegex (
100- "^" + ClientSideSDKStreamingBasePath + ClientSideOrMobileUserSubpath + ".* " ,
98+ "^" + ClientSideSDKStreamingBasePath + arbitraryPathComponentRegex + arbitraryPathComponentRegex + "$ " ,
10199 httphelpers .HandlerForMethod ("GET" , handler , nil ),
102100 httphelpers .HandlerForPath (
103101 MobileSDKStreamingBasePath ,
104102 httphelpers .HandlerForMethod ("REPORT" , handler , nil ),
105103 httphelpers .HandlerForPathRegex (
106- "^" + MobileSDKStreamingBasePath + ClientSideOrMobileUserSubpath + ".* " ,
104+ "^" + MobileSDKStreamingBasePath + arbitraryPathComponentRegex + "$ " ,
107105 httphelpers .HandlerForMethod ("GET" , handler , nil ),
108106 nil ,
109107 ),
0 commit comments