<commit_before>-- Copyright (C) 2018 by chrono

-- curl 127.1:81/capture

ngx.say('now capture proxy_pass:\n')

local res = ngx.location.capture('/hello')

if res.status ~= ngx.HTTP_OK then
    ngx.exit(res.status)
end

ngx.print(res.body)


ngx.say('\nnow capture redis2_pass:\n')

local res = ngx.location.capture(
                '/ngx_redis2',
                {args = {key='metroid'}})

ngx.print(res.body)<commit_msg>capture.lua<commit_after>-- Copyright (C) 2018 by chrono

-- curl 127.1:81/capture

ngx.say('now capture proxy_pass:\n')

local capture = ngx.location.capture

local res = capture('/hello')

if res.status ~= ngx.HTTP_OK then
    ngx.exit(res.status)
end

ngx.print(res.body)


ngx.say('\nnow capture redis2_pass:\n')

local res = capture('/ngx_redis2',
                {args = {key='metroid'}})

ngx.print(res.body)
{'fraction_non_alphanumeric': 0.16248506571087215, 'fraction_numerical': 0.02867383512544803, 'mean_word_length': 3.2323232323232323, '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': '3073155', 'n_tokens_mistral': 338, 'n_tokens_neox': 319, 'n_words': 63}