asp.net mvc - Request.Url.Host returns the wrong host? -
i have single umbraco 7 instance has 2 root nodes. 1 node points stage.sctflash.com , other node points stage.bullydog.com. when navigate http://stage.bullydog.com/products/accessories/podmount, request.url.host stage.bullydog.com. now, if open tab , go http://stage.sctflash.com/products/accessories/podmount, request.url.host might stage.sctflash.com, sometimes, changes stage.sctflash.com.
the 1 strange thing noticed if view accessories node in umbraco, noticed parent of stage.bullydog.com no matter if on stage.sctflash.com or stage.bullydog.com
i using request.url.host determine query parameter database. getting brand this:
if(request.url.host == "stage.sctflash.com") return "sct"; else return bullydog"; so if request.url.host intermittently wrong, wrong query parameter.
to see in action, if go http://stage.sctflash.com/products/accessories/podmount, see sct logo, go http://stage.bullydog.com/products/accessories/podmount , see bully dog logo. these logos driven request.url.host. if refresh http://stage.sctflash.com/products/accessories/podmount, see bully dog logo because request.url.host stage.bullydog.com instead of stage.sctflash.com
this action method called when go page: http://stage.sctflash.com/products/accessories/podmount
public actionresult getaccessoriesbytype(rendermodel model, string id) { string brand = common.getproductbrand(request.url.host); var productsearchresultsmodel = new productsearchresultsmodel { accessories = _accessoryrepository.getaccessoriesbytype(id, brand) }; return view("~/views/accessories.cshtml", productsearchresultsmodel); }