<commit_before>/**
 * @file Pring Access/Proxy log
 * @author zdying
 */
'use strict';

module.exports = function (ctx, next) {
  var req = ctx.req;
  var proxyOption = req.proxyOptions;

  if (req.PROXY) {
    if (req.proxyPass) {
      log.access(req, (proxyOption.protocol || 'http:') + '//' + proxyOption.hostname +
        (proxyOption.port ? ':' + proxyOption.port : '') + proxyOption.path);
    } else {
      log.access(req, '(local file system or echo)');
    }
  } else {
    log.access(req);
  }
  next();
};
<commit_msg>fix alias directive proxy log<commit_after>/**
 * @file Pring Access/Proxy log
 * @author zdying
 */
'use strict';

module.exports = function (ctx, next) {
  var req = ctx.req;
  var proxyOption = req.proxyOptions;

  if (req.PROXY) {
    if (req.alias) {
      log.access(req, req.proxyPass ? '(alias to ' + req.proxyPass + ')' : '(alias directive)');
    } else if (req.proxyPass) {
      log.access(req, (proxyOption.protocol || 'http:') + '//' + proxyOption.hostname +
        (proxyOption.port ? ':' + proxyOption.port : '') + proxyOption.path);
    } else {
      log.access(req, '(local file system or echo)');
    }
  } else {
    log.access(req);
  }
  next();
};

{'fraction_non_alphanumeric': 0.17925311203319502, 'fraction_numerical': 0.0, 'mean_word_length': 2.853035143769968, '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': '7560244', 'n_tokens_mistral': 421, 'n_tokens_neox': 422, 'n_words': 94}