<commit_before>(function(mifosX) {
  var defineHeaders = function($httpProvider , $translateProvider, ResourceFactoryProvider ,HttpServiceProvider,TENANT ,CONTENT_TYPE , HOST ) {

    // Set Host name, if accessed from file system
    var protocol = window.location.protocol;
    if (protocol === 'file:') {
        ResourceFactoryProvider.setBaseUrl(HOST);
        HttpServiceProvider.addRequestInterceptor('demoUrl', function(config) {
            return _.extend(config, {url: HOST + config.url});
        });

        $httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = TENANT;

     }
     else{
          // For multi tenant hosting
          var hostname = window.location.hostname;
          domains = hostname.spli('.');

          if(domains[0] == "demo"){
                  $httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = TENANT;
          }
          else{
                  $httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = domains[0];
          }
     }   


  	//Set headers<commit_msg>added logic to read sub domain and set tenant id<commit_after>(function(mifosX) {
  var defineHeaders = function($httpProvider , $translateProvider, ResourceFactoryProvider ,HttpServiceProvider,TENANT ,CONTENT_TYPE , HOST ) {

    // Set Host name, if accessed from file system
    var protocol = window.location.protocol;
    if (protocol === 'file:') {
        ResourceFactoryProvider.setBaseUrl(HOST);
        HttpServiceProvider.addRequestInterceptor('demoUrl', function(config) {
            return _.extend(config, {url: HOST + config.url});
        });

        $httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = TENANT;

     }
     else{
          // For multi tenant hosting
          var hostname = window.location.hostname;
          domains = hostname.split('.');

          if(domains[0] == "demo"){
                  $httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = TENANT;
          }
          else{
                  $httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = domains[0];
          }
     }   


  	//Set headers
{'fraction_non_alphanumeric': 0.12267657992565056, 'fraction_numerical': 0.0018587360594795538, 'mean_word_length': 2.5295081967213116, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5079804', 'n_tokens_mistral': 617, 'n_tokens_neox': 600, 'n_words': 112}