File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,20 @@ func singleJoiningSlash(a, b string) string {
3232func NewSegmentReverseProxy (cdn * url.URL , trackingAPI * url.URL ) http.Handler {
3333 director := func (req * http.Request ) {
3434 // Figure out which server to redirect to based on the incoming request.
35+ // https://segment-cdn.dayforward.com/analytics-next/bundles/130.bundle.9457873b007a93e16765.js
36+ // https://segment-cdn.dayforward.com/analytics-next/bundles/ajs-destination.bundle.c473a3426ccbc3cdfba0.js
37+ // https://prod-segment-cdn.dayforward.com/next-integrations/integrations/facebook-pixel/2.11.4/facebook-pixel.dynamic.js.gz
3538 var target * url.URL
36- if strings .HasPrefix (req .URL .String (), "/v1/projects" ) || strings .HasPrefix (req .URL .String (), "/analytics.js/v1" ) {
39+ switch {
40+ case strings .HasPrefix (req .URL .String (), "/v1/projects" ):
41+ fallthrough
42+ case strings .HasPrefix (req .URL .String (), "/analytics.js/v1" ):
43+ fallthrough
44+ case strings .HasPrefix (req .URL .String (), "/next-integrations" ):
45+ fallthrough
46+ case strings .HasPrefix (req .URL .String (), "/analytics-next/bundles" ):
3747 target = cdn
38- } else {
48+ default :
3949 target = trackingAPI
4050 }
4151
You can’t perform that action at this time.
0 commit comments