<commit_before>var fs      = require('fs');
var qs      = require('qs');
var express = require('express');
var router  = express.Router();
var Request = require('../models/Request');
var legRequest = require('request');

var latestVersion = '1.1';

router.get('/', (req, res, next) => {
  genUser(req, res, latestVersion);
});

router.get('/:version', (req, res, next) => {
  genUser(req, res, req.params.version);
});

let legacy = {
  "0.1": {
    hash: "916ad3d01e4040cc0a67e0367f887f19",
    max: 5
  },
  "0.2": {
    hash: "74af1a1572d1065ba63f11afb6ba34ee",
    max: 5
  },
  "0.2.1": {
    hash: "d462956eec6157ab03164c565682f3d6",
    max: 5
  },
  "0.3": {
    hash: "cc4b5abca158d7fe0bbb92dcd591114c",
    max: 10
  },
  "0.3.1": {
    hash: "52432a28e766d8142b811436742ec905",
    max: 10
  },
  "0.3.2": {
    hash: "7c25fc35021cdab8bcc0bc20d352a064",
    max: 10
  },
  "0.4": {
    hash: "884bcc24441f39bddfe17e12a080ab7f",
    max: 20
  },
  "0.4.1": {
    hash: "127ee4298ee834d84b33b4ff6f544ed0",
    max: 100
  },
  "0.5": {
    hash: "4111cf8ceae827c5c7659e2ed6238a18",
    max: 100
  },
  "0.6": {
    hash: "418b98dfb9a79a966bf4bb951665856f",
    max: 100
  }
};

function genUser(req, res, version) {
  req.query.fmt = req.query.format;

  var ip = req.headers['cf-connecting-ip'] || req.headers['x-real-ip'] || req.headers['x-forwarded-for'] || req.connection.remoteAddress;<commit_msg>Fix query parameter according to spec<commit_after>var fs      = require('fs');
var qs      = require('qs');
var express = require('express');
var router  = express.Router();
var Request = require('../models/Request');
var legRequest = require('request');

var latestVersion = '1.1';

router.get('/', (req, res, next) => {
  genUser(req, res, latestVersion);
});

router.get('/:version', (req, res, next) => {
  genUser(req, res, req.params.version);
});

let legacy = {
  "0.1": {
    hash: "916ad3d01e4040cc0a67e0367f887f19",
    max: 5
  },
  "0.2": {
    hash: "74af1a1572d1065ba63f11afb6ba34ee",
    max: 5
  },
  "0.2.1": {
    hash: "d462956eec6157ab03164c565682f3d6",
    max: 5
  },
  "0.3": {
    hash: "cc4b5abca158d7fe0bbb92dcd591114c",
    max: 10
  },
  "0.3.1": {
    hash: "52432a28e766d8142b811436742ec905",
    max: 10
  },
  "0.3.2": {
    hash: "7c25fc35021cdab8bcc0bc20d352a064",
    max: 10
  },
  "0.4": {
    hash: "884bcc24441f39bddfe17e12a080ab7f",
    max: 20
  },
  "0.4.1": {
    hash: "127ee4298ee834d84b33b4ff6f544ed0",
    max: 100
  },
  "0.5": {
    hash: "4111cf8ceae827c5c7659e2ed6238a18",
    max: 100
  },
  "0.6": {
    hash: "418b98dfb9a79a966bf4bb951665856f",
    max: 100
  }
};

function genUser(req, res, version) {
  req.query.fmt = req.query.fmt || req.query.format;

  var ip = req.headers['cf-connecting-ip'] || req.headers['x-real-ip'] || req.headers['x-forwarded-for'] || req.connection.remoteAddress;
{'fraction_non_alphanumeric': 0.18385180006990562, 'fraction_numerical': 0.17266689968542467, 'mean_word_length': 3.323262839879154, 'pattern_counts': {'":': 20, '<': 3, '<?xml version=': 0, '>': 7, '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': '292624', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1286, 'n_words': 203}