<commit_before>const nextHandlerWrapper = app => {
  const handler = app.getRequestHandler()
  return async ({ raw, url }, h) => {
    await handler(raw.req, raw.res, url)
    return h.close
  }
}
const defaultHandlerWrapper = app => async ({ raw: { req, res }, url }) => {
  const { pathname, query } = url
  return app.renderToHTML(req, res, pathname, query)
}

const pathWrapper = (app, pathName, opts) => async ({ raw, query, params }) => {
  return app.renderToHTML(
    raw.req,
    raw.res,
    pathName,
    { ...query, ...params },
    opts
  )
}

module.exports = { pathWrapper, defaultHandlerWrapper, nextHandlerWrapper }<commit_msg>feat(web): Passing actual status code instead 200 (#7735)<commit_after>const nextHandlerWrapper = app => {
  const handler = app.getRequestHandler()
  return async ({ raw, url }, h) => {
    await handler(raw.req, raw.res, url)
    return h.close
  }
}
const defaultHandlerWrapper = app => async ({ raw: { req, res }, url }, h) => {
  const { pathname, query } = url
  const html = await app.renderToHTML(req, res, pathname, query)
  return h.response(html).code(res.statusCode)
}

const pathWrapper = (app, pathName, opts) => async ({ raw, query, params }, h) => {
  const html = await app.renderToHTML(
    raw.req,
    raw.res,
    pathName,
    { ...query, ...params },
    opts
  )
  return h.response(html).code(raw.res.statusCode)
}

module.exports = { pathWrapper, defaultHandlerWrapper, nextHandlerWrapper }
{'fraction_non_alphanumeric': 0.14863013698630137, 'fraction_numerical': 0.004794520547945206, 'mean_word_length': 3.467889908256881, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3095865', 'n_tokens_mistral': 473, 'n_tokens_neox': 467, 'n_words': 127}