@@ -242,11 +242,9 @@ public virtual LogEvent CreateImpressionEvent(ProjectConfig config, Experiment e
242
242
GetImpressionOrConversionParamsWithCommonParams ( commonParams ,
243
243
new object [ ] { impressionOnlyParams } ) ;
244
244
245
- var region = ! string . IsNullOrEmpty ( config . Region ) ? config . Region : "US" ;
245
+ var region = ! string . IsNullOrEmpty ( config . Region ) && EventFactory . EventEndpoints . ContainsKey ( config . Region ) ? config . Region : "US" ;
246
246
247
- var endpoint = EventFactory . EventEndpoints . ContainsKey ( region )
248
- ? EventFactory . EventEndpoints [ region ]
249
- : EventFactory . EventEndpoints [ "US" ] ;
247
+ var endpoint = EventFactory . EventEndpoints [ region ]
250
248
251
249
return new LogEvent( endpoint , impressionParams , HTTP_VERB , HTTP_HEADERS ) ;
252
250
}
@@ -274,11 +272,9 @@ public virtual LogEvent CreateConversionEvent(ProjectConfig config, string event
274
272
var conversionParams =
275
273
GetImpressionOrConversionParamsWithCommonParams ( commonParams , conversionOnlyParams ) ;
276
274
277
- var region = ! string . IsNullOrEmpty ( config . Region ) ? config . Region : "US" ;
275
+ var region = ! string . IsNullOrEmpty ( config . Region ) && EventFactory . EventEndpoints . ContainsKey ( config . Region ) ? config . Region : "US" ;
278
276
279
- var endpoint = EventFactory . EventEndpoints . ContainsKey ( region )
280
- ? EventFactory . EventEndpoints [ region ]
281
- : EventFactory . EventEndpoints [ "US" ] ;
277
+ var endpoint = EventFactory . EventEndpoints [ region ]
282
278
283
279
return new LogEvent( endpoint , conversionParams , HTTP_VERB , HTTP_HEADERS ) ;
284
280
}
0 commit comments