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 {
32
32
func NewSegmentReverseProxy (cdn * url.URL , trackingAPI * url.URL ) http.Handler {
33
33
director := func (req * http.Request ) {
34
34
// 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
35
38
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" ):
37
47
target = cdn
38
- } else {
48
+ default :
39
49
target = trackingAPI
40
50
}
41
51
You can’t perform that action at this time.
0 commit comments