<commit_before>// test rewriting of urls like '/' to '/index.html'
require('./common');
var filename = path.join(settings.hosts['examplevirtualhost.com'].root, "folder/index.html");
var indexText = fs.readFileSync(filename, 'binary');

exports["'GET /folder' returns '302 Found: http://examplevirtualhost.com/folder/'"] = function(test) {
    antinode.start(settings, function() {
        test_http(test,
              {
                  'method':'GET',
                  'pathname':'/folder',
                  'headers': {
                      'host': 'examplevirtualhost.com'
                  }
              },
              {
                  'statusCode':302,
                  'body':'',
                  'headers': {
                      'location': 'http://examplevirtualhost.com/folder/'
                  }
              }, 
              function() { 
                  antinode.stop(); 
                  test.done();
              }
         );
    });
};
exports["'GET /folder/' returns 200, text of /folder/index.html"] = function(test) {
    antinode.start(settings, function() {
        test_http(test,
              {
                  'method':'GET',
                  'pathname':'/folder/',
                  'headers': {
                      'host': 'examplevirtualhost.com'
                  }
              },
              {
                  'statusCode':200,
                  'body':indexText
              },
              function() { 
                  antinode.stop(); 
                  test.done();
              }
         );
    });
};
<commit_msg>Added two new tests for URLs containing query strings.<commit_after>// test rewriting of urls like '/' to '/index.html'
require('./common');
var filename = path.join(settings.hosts['examplevirtualhost.com'].root, "folder/index.html");
var indexText = fs.readFileSync(filename, 'binary');

exports["'GET /folder' returns '302 Found: http://examplevirtualhost.com/folder/'"] = function(test) {
    antinode.start(settings, function() {
        test_http(test,
              {
                  'method':'GET',
                  'pathname':'/folder',
                  'headers': {
                      'host': 'examplevirtualhost.com'
                  }
              },
              {
                  'statusCode':302,
                  'body':'',
                  'headers': {
                      'location': 'http://examplevirtualhost.com/folder/'
                  }
              }, 
              function() { 
                  antinode.stop(); 
                  test.done();
              }
         );
    });
};
exports["'GET /folder/' returns 200, text of /folder/index.html"] = function(test) {
    antinode.start(settings, function() {
        test_http(test,
              {
                  'method':'GET',
                  'pathname':'/folder/',
                  'headers': {
                      'host': 'examplevirtualhost.com'
                  }
              },
              {
                  'statusCode':200,
                  'body':indexText
              },
              function() { 
                  antinode.stop(); 
                  test.done();
              }
         );
    });
};
exports["'GET /folder?param1=value1&param2=value2' returns '302 Found: http://examplevirtualhost.com/folder/'"] = function(test) {
    antinode.start(settings, function() {
        test_http(test,
              {
                  'method':'GET',
                  'pathname':'/folder?param1=value1&param2=value2',
                  'headers': {
                      'host': 'examplevirtualhost.com'
                  }
              },
              {
                  'statusCode':302,
                  'body':'',
                  'headers': {
                      'location': 'http://examplevirtualhost.com/folder/?param1=value1&param2=value2'
                  }
              }, 
              function() { 
                  antinode.stop(); 
                  test.done();
              }
         );
    });
};
exports["'GET /folder/?param1=value1&param2=value2' returns 200, text of /folder/index.html"] = function(test) {
    antinode.start(settings, function() {
        test_http(test,
              {
                  'method':'GET',
                  'pathname':'/folder/?param1=value1&param2=value2',
                  'headers': {
                      'host': 'examplevirtualhost.com'
                  }
              },
              {
                  'statusCode':200,
                  'body':indexText
              },
              function() { 
                  antinode.stop(); 
                  test.done();
              }
         );
    });
};

{'fraction_non_alphanumeric': 0.14045898852528688, 'fraction_numerical': 0.011899702507437314, 'mean_word_length': 1.1183618361836183, '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': '7617715', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1142, 'n_words': 174}