将爬虫采集器替换并嵌入合并到系统中,大幅度提高爬取速度

master
wufayuan 2 years ago
parent d0f631cd44
commit bc85f26e39

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

@ -0,0 +1,121 @@
# -*- coding: utf-8 -*-
"""
Created on Tue May 24 15:49:30 2022
@author: Jation
"""
import pandas as pd
import numpy as np
import pymysql
from HTMLTable import HTMLTable
import argparse
b = []
a={"1": {"name": "test", "college": "test", "major": "test", "paper": "test"}, "2": {"name": "test", "college": "test", "major": "test", "paper": "test"}, "3": {"name": "test", "college": "test", "major": "test", "paper": "test"}, "4": {"name": "test", "college": "test", "major": "test", "paper": "test"}, "5": {"name": "test", "college": "test", "major": "test", "paper": "test"}, "6": {"name": "test", "college": "test", "major": "test", "paper": "test"}, "type": "response"}
for i in a:
#print(a[i])
if(i == 'type'):
continue
d = []
for c in a[i].values():
d.append(c)
b.append(d)
# d.append(c)
#b.append(d)
#print(a)
#print(b)
def shu(a):
table = HTMLTable(caption='输出结果')
# 表头行
table.append_header_rows((
('name', 'test', 'college', 'major'),
))
# 合并单元格
data_1 = a
# 数据行
table.append_data_rows((
data_1
))
# 标题样式
table.caption.set_style({
'font-size': '30px',
'font-weight': 'bold',
'margin': '10px',
})
# 表格样式,即<table>标签样式
table.set_style({
'border-collapse': 'collapse',
'word-break': 'normal',
'white-space': 'normal',
'font-size': '14px',
})
# 统一设置所有单元格样式,<td>或<th>
table.set_cell_style({
'border-color': '#000',
'border-width': '1px',
'border-style': 'solid',
'padding': '5px',
})
# 表头样式
table.set_header_row_style({
'color': '#fff',
'background-color': '#48a6fb',
'font-size': '18px',
})
# 覆盖表头单元格字体样式
table.set_header_cell_style({
'padding': '15px',
})
# 调小次表头字体大小
# 遍历数据行,如果增长量为负,标红背景颜色
html = table.to_html()
f = open('C:/Users/Jation/Desktop/应用开发/dcs/ui/comment.html','w',encoding = 'utf-8-sig')
f.write(html)
# 1. 连接数据库,
conn = pymysql.connect(
host='10.129.16.173',
user='root',
password='427318Aa',
db='test',
charset='utf8',
# autocommit=True, # 如果插入数据,, 是否自动提交? 和conn.commit()功能一致。
)
# ****python, 必须有一个游标对象, 用来给数据库发送sql语句 并执行的.
# 2. 创建游标对象,
cur = conn.cursor()
# 3. 对于数据库进行增删改查
parser = argparse.ArgumentParser('Automanager')
parser.add_argument('--id', type = str, required = True)
# 自动发微博
args = parser.parse_args()
id = args.id
# 4). **************************数据库查询*****************************
sqli = "select name,college,major,paper from "+ id+"_crawl_result;"
print(sqli)
result = cur.execute(sqli) # 默认不返回查询结果集, 返回数据记录数。
print(result)
'''print(cur.fetchone()) # 1). 获取下一个查询结果集;
print(cur.fetchone())
print(cur.fetchone())
print(cur.fetchmany(4))''' # 2). 获取制定个数个查询结果集;
info = cur.fetchall() # 3). 获取所有的查询结果
print(info)
# 5). 移动游标指针
path = "C:/Users/Jation/Desktop/应用开发/dcs/ui/comment.csv"
f = open(path,'w')
f.truncate()
shu(info)
# 4. 关闭游标
cur.close()
# 5. 关闭连接
conn.close()

File diff suppressed because one or more lines are too long

@ -85,7 +85,7 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
local_port = 10004 local_port = 9010
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_socket.connect((args.ip, int(args.port))) server_socket.connect((args.ip, int(args.port)))
@ -98,7 +98,7 @@ if __name__ == '__main__':
elif args.action == 'login' or args.action == 'register': elif args.action == 'login' or args.action == 'register':
request = {'action': args.action, 'user': args.user, 'password': args.password} request = {'action': args.action, 'user': args.user, 'password': args.password}
response = send_request(request, server_socket) response = send_request(request, server_socket)
print(response) print(response['cookie'])
if args.action == 'crawling': if args.action == 'crawling':
receive_response(server_socket) receive_response(server_socket)

@ -0,0 +1,198 @@
import json
import socket
import struct
import argparse
from json import JSONEncoder, JSONDecoder
import pymysql
from HTMLTable import HTMLTable
import pandas as pd
import numpy as np
import json
def parse_request(client_socket: socket.socket):
request_header_size = struct.unpack("!Q", read_bytes(client_socket, 8))[0]
request_map = json.JSONDecoder().decode(read_bytes(client_socket, request_header_size).decode("utf-8"))
return request_map
def generate_request(request_info) -> 'bytes':
"""
根据传入的dict生成请求
请求包含 8字节头长度+头数据
:param request_info: dict
:return: bytes 请求数据
"""
request_bytes = JSONEncoder().encode(request_info).encode("utf-8")
return struct.pack("!Q", len(request_bytes)) + request_bytes
def read_bytes(s: 'socket.socket', size: 'int') -> 'bytes':
"""
从socket读取size个字节
:param s:套接字
:param size:要读取的大小
:return:读取的字节数在遇到套接字关闭的情况下返回的数据的长度可能小于 size
"""
data = ''.encode('utf-8')
while len(data) < size:
rsp_data = s.recv(size - len(data))
data += rsp_data
if len(rsp_data) == 0:
break
return data
def shu(a):
table = HTMLTable(caption='输出结果')
# 表头行
table.append_header_rows((
('name', 'college', 'major', 'paper'),
))
# 合并单元格
data_1 = a
# 数据行
table.append_data_rows((
data_1
))
# 标题样式
table.caption.set_style({
'font-size': '30px',
'font-weight': 'bold',
'margin': '10px',
})
# 表格样式,即<table>标签样式
table.set_style({
'border-collapse': 'collapse',
'word-break': 'normal',
'white-space': 'normal',
'font-size': '14px',
})
# 统一设置所有单元格样式,<td>或<th>
table.set_cell_style({
'border-color': '#000',
'border-width': '1px',
'border-style': 'solid',
'padding': '5px',
})
# 表头样式
table.set_header_row_style({
'color': '#fff',
'background-color': '#48a6fb',
'font-size': '18px',
})
# 覆盖表头单元格字体样式
table.set_header_cell_style({
'padding': '15px',
})
# 调小次表头字体大小
table[1].set_cell_style({
'padding': '8px',
'font-size': '15px',
})
# 遍历数据行,如果增长量为负,标红背景颜色
html = table.to_html()
f = open('C:/Users/Jation/Desktop/应用开发/dcs/ui/tmmps.html','w',encoding = 'utf-8-sig')
f.write(html)
def send_request(ip, port, request_info):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) as socket_to_server:
socket_to_server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
socket_to_server.bind(('', 9005))
socket_to_server.connect((ip, int(port)))
full_request = generate_request(request_info)
socket_to_server.sendall(full_request)
responseJson = JSONDecoder().decode(
read_bytes(socket_to_server, struct.unpack('!Q', socket_to_server.recv(8))[0]).decode(
"utf-8"))
return responseJson
def receive_response():
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_socket.bind(('', 9005))
server_socket.listen()
while True:
client_socket, _ = server_socket.accept()
request_map = parse_request(client_socket)
if request_map['type'] == 'response':
print("receiving response:\n" + json.dumps(request_map, ensure_ascii=False))
a = json.dumps(request_map, ensure_ascii=False)
a = json.loads(a)
b = []
c =''
d =''
for i in a:
#print(a[i])
if(i == 'type'):
continue
if(i == 'crawl_id'):
c = a[i]
c = str(c)
if(i == 'table_name'):
d = a[i]
'''for c in a[i].values():
d.append(c)'''
b.append(d)
continue
sqli = "select name,college,major,paper from "+d+" where crawl_id = " +c+";"
result = cur.execute(sqli)
info = cur.fetchall()
shu(info)
break
conn = pymysql.connect(
host='10.129.16.173',
user='root',
password='427318Aa',
db='test',
charset='utf8',
# autocommit=True, # 如果插入数据,, 是否自动提交? 和conn.commit()功能一致。
)
cur = conn.cursor()
if __name__ == '__main__':
# 使用方法 python .\connect.py --ip 127.0.0.1 --port 7777
# crawling --word computer --cookie 95f94e1ab71bdf96b85fef6e8f746c58eeb5f9fa --pages_start 1 --pages_end 10
parser = argparse.ArgumentParser('connect-manager')
parser.add_argument('--ip', type=str, required=True)
parser.add_argument('--port', type=str, required=True)
subparsers = parser.add_subparsers(help='provide actions including crawling, login, register',
dest='action') # 创建子解析器
parser_crawling = subparsers.add_parser('crawling')
parser_crawling.add_argument('--word', type=str, required=True)
parser_crawling.add_argument('--pages_end', type=int, required=True)
parser_crawling.add_argument('--pages_start', type=int, required=True)
parser_crawling.add_argument('--cookie', type=str, required=True)
parser_login = subparsers.add_parser('login')
parser_login.add_argument('--user', type=str, required=True)
parser_login.add_argument('--password', type=str, required=True)
parser_register = subparsers.add_parser('register')
parser_register.add_argument('--user', type=str, required=True)
parser_register.add_argument('--password', type=str, required=True)
args = parser.parse_args()
request = dict()
if args.action == 'crawling':
request = {'action': 'crawl zhiwang', 'word': args.word, 'pages_start': args.pages_start,
'pages_end': args.pages_end, 'cookie': args.cookie}
elif args.action == 'login' or args.action == 'register':
request = {'action': args.action, 'user': args.user, 'password': args.password}
response = send_request(args.ip, args.port, request)
if args.action == 'crawling':
receive_response()

@ -0,0 +1,106 @@
import json
import socket
import struct
import argparse
from json import JSONEncoder, JSONDecoder
def parse_request(client_socket: socket.socket):
request_header_size = struct.unpack("!Q", read_bytes(client_socket, 8))[0]
request_map = json.JSONDecoder().decode(read_bytes(client_socket, request_header_size).decode("utf-8"))
return request_map
def generate_request(request_info) -> 'bytes':
"""
根据传入的dict生成请求
请求包含 8字节头长度+头数据
:param request_info: dict
:return: bytes 请求数据
"""
request_bytes = JSONEncoder().encode(request_info).encode("utf-8")
return struct.pack("!Q", len(request_bytes)) + request_bytes
def read_bytes(s: 'socket.socket', size: 'int') -> 'bytes':
"""
从socket读取size个字节
:param s:套接字
:param size:要读取的大小
:return:读取的字节数在遇到套接字关闭的情况下返回的数据的长度可能小于 size
"""
data = ''.encode('utf-8')
while len(data) < size:
rsp_data = s.recv(size - len(data))
data += rsp_data
if len(rsp_data) == 0:
break
return data
def send_request(ip, port, request_info):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) as socket_to_server:
socket_to_server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
socket_to_server.bind(('', 9005))
socket_to_server.connect((ip, int(port)))
full_request = generate_request(request_info)
socket_to_server.sendall(full_request)
responseJson = JSONDecoder().decode(
read_bytes(socket_to_server, struct.unpack('!Q', socket_to_server.recv(8))[0]).decode(
"utf-8"))
return responseJson
def receive_response():
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_socket.bind(('', 9005))
server_socket.listen()
while True:
client_socket, _ = server_socket.accept()
request_map = parse_request(client_socket)
if request_map['type'] == 'response':
print("receiving response:\n" + json.dumps(request_map, ensure_ascii=False))
break
if __name__ == '__main__':
# 使用方法 python .\connect.py --ip 127.0.0.1 --port 7777
# crawling --word computer --cookie 95f94e1ab71bdf96b85fef6e8f746c58eeb5f9fa --pages_start 1 --pages_end 10
parser = argparse.ArgumentParser('connect-manager')
parser.add_argument('--ip', type=str, required=True)
parser.add_argument('--port', type=str, required=True)
subparsers = parser.add_subparsers(help='provide actions including crawling, login, register',
dest='action') # 创建子解析器
parser_crawling = subparsers.add_parser('crawling')
parser_crawling.add_argument('--word', type=str, required=True)
parser_crawling.add_argument('--pages_end', type=int, required=True)
parser_crawling.add_argument('--pages_start', type=int, required=True)
parser_crawling.add_argument('--cookie', type=str, required=True)
parser_login = subparsers.add_parser('login')
parser_login.add_argument('--user', type=str, required=True)
parser_login.add_argument('--password', type=str, required=True)
parser_register = subparsers.add_parser('register')
parser_register.add_argument('--user', type=str, required=True)
parser_register.add_argument('--password', type=str, required=True)
args = parser.parse_args()
request = dict()
if args.action == 'crawling':
request = {'action': 'crawl zhiwang', 'word': args.word, 'pages_start': args.pages_start,
'pages_end': args.pages_end, 'cookie': args.cookie}
elif args.action == 'login' or args.action == 'register':
request = {'action': args.action, 'user': args.user, 'password': args.password}
response = send_request(args.ip, args.port, request)
print(response['cookie'])
if args.action == 'crawling':
receive_response()

@ -0,0 +1,183 @@
*{
padding: 0;
margin:0;
box-sizing: border-box;
font-family: 'Poppins',sans-serif;
}
/* 设置整个表单参数 (父盒子)*/
section {
position: relative;
min-height: 100vh;
background-image:url(1.jpg);
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
section .container {
position: relative;
width: 550px;
height: 350px;
background: rgb(17, 168, 168);
box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
section .container .user{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
}
/* 更改图片 (左侧)*/
section .container .imgBx{
position: relative;
width: 50%;
height: 100%;
/* background: #fff; */
transition: .5s;
}
section .container .user .imgBx img{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
/* 右侧表单盒子 */
section .container .user .formBx {
position: relative;
width: 50%;
height: 100%;
background: #fff;
display: flex;
justify-content: center;
align-items: center;
padding: 40px;
transition: .5s;
}
/* h2 */
section .container .user .formBx form h2{
font-size: 18px;
font-weight: 600;
text-transform: uppercase;/*大小*/
letter-spacing: 2px;/* 间距*/
text-align: center;
width: 100%;
margin-bottom: 10px;
color: #555;
}
/* 表单文字属性 */
section .container .user .formBx form input{
position: relative;
width: 100%;
padding: 10px;
background: #f5f5f5;
color: #333;
border: none;
outline:none;
box-shadow:none;
margin: 8px 0;
font-size: 14px;
letter-spacing:1px;
font-weight: 300;
}
/* 为登录设置样式 */
section .container .user .formBx form input[type="submit"]{
max-width: 100px;
background: #677eff;
color:#fff;
cursor:pointer;
font-size: 14px;
font-weight: 500;
letter-spacing: 1px;
transition: .5s;
}
/* 没有账号时 */
section .container .user .formBx form .signup{
position: relative;
margin-top: 20px;
font-size: 12px;
letter-spacing: 1px;
color: #555;
text-transform: uppercase;
font-weight: 300;
}
section .container .user .formBx form .signup a{
font-weight: 600;
text-decoration: none;
color: #677eff;
}
section .container .singupBx {
pointer-events: none;
}
section .container.active .singupBx {
pointer-events: initial;
}
section .container .singupBx .formBx {
left: 100%;
}
section .container.active .singupBx .formBx {
left: 0;
}
section .container .singupBx .imgBx {
left: -100%;
}
section .container.active .singupBx .imgBx {
left: 0;
}
section .container .singinBx .formBx {
left: 0;
}
section .container.active .singinBx .formBx {
left: 100%;
}
section .container .singinBx .imgBx {
left: 0;
}
section .container.active .singinBx .imgBx {
left: 100%;
}
@media (max-width: 991px) {
section .container {
max-width: 400px;
}
section .container .imgBx {
display: none;
}
section .container .user .formBx {
width: none;
}
}

@ -1 +0,0 @@
python .\connect.py --ip 127.0.0.1 --port 7777 login --user liuxiaoyu --password 113818

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录</title>
<link rel="stylesheet" href="default.css">
<link rel="shortcut icon" href="img/favicon.ico">
</head>
<body>
<section>
<!-- 登录 -->
<div class="container">
<div class="user singinBx">
<div class="imgBx"><img src="2.jpg" alt=""></div>
<div class="formBx">
<form action="/login">
<h2><font size="10">登录</font></h2>
<input type="text" name="name" placeholder="username">
<input type="password" name="pwd" placeholder="password">
<input type="submit" name="" value="登录" onclick="alart(登录成功)">
<p class="signup">没有账号?<a href="#" onclick="topggleForm();">注册</a></p>
</form>
</div>
</div>
<!-- 注册 -->
<div class="user singupBx">
<div class="formBx">
<form action="/register">
<h2><font size="10">注册</font></h2>
<label><input class="text" type="text" placeholder="username" name="name" /></label>
<label><input class="text" type="password" placeholder="password" name="pwd" /></label>
<input type="submit" value="提交" onclick="注册成功">
<p class="signup">已有账号?<a href="#" onclick="topggleForm();">登录</a></p>
</form>
</div>
<div class="imgBx"><img src="3.jpg" alt=""></div>
</div>
</div>
</section>
<script type="text/javascript">
function topggleForm(){
var container = document.querySelector('.container');
container.classList.toggle('active');
}
</script>
</body>
</html>

@ -1,21 +1,48 @@
var fs = require("fs"); var express = require('express')
var bodyParser = require('body-parser'); // 这个模块是获取post请求传过来的数据。 var path = require("path");
var multer = require('multer'); //multer - node.js 中间件,用于处理 enctype="multipart/form-data"设置表单的MIME编码的表单数据。 var mysql = require('mysql')
var express=require('express'); //var alert = require('alert')
var app=express(); //var router = express.Router()
var mysql=require('mysql'); var app = express()
const {get} = require('http')
const multer = require('multer')
var childProcess = require('child_process')
const bodyParser = require('body-parser')
const fs = require('fs')
//const document = require('document')
var jsdom = require("jsdom");
const { NULL } = require('mysql/lib/protocol/constants/types');
var JSDOM = jsdom.JSDOM;
var document = new JSDOM().window.document;
var execSync = require("child_process").execSync; var execSync = require("child_process").execSync;
var fs = require("fs"); var sys = require('sys');
//var exec = require('child_process').exec
//const cp = require('child_process');
var session = require("express-session");
var FileStore = require('session-file-store')(session);
var identityKey = 'skey';
app.use(
session({
name: identityKey,
secret: "jhh",
store: new FileStore(), //加密存储
resave: false, //客户端并行请求是否覆盖
saveUninitialized: true, //初始化session存储
cookie: {
maxAge: 1000*60*10 // 这一条 是控制 sessionID 的过期时间的!!!
},
})
);
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.use(express.static('./'))
/** /**
* 配置MySql * 配置MySql
*/ */
var connection = mysql.createConnection({ var connection = mysql.createConnection({
// host : '192.168.43.64', host : '192.168.43.65',
// host : '10.129.16.173',
host : '127.0.0.1',
user : 'root', user : 'root',
// password : '427318Aa', password : '427318Aa',
password : 'xwdjzwy5252',
database : 'test', database : 'test',
port:'3306' port:'3306'
}); });
@ -24,19 +51,25 @@ app.use('/public', express.static('public')); // 设置静态文件的中间件
app.use(bodyParser.urlencoded({ extended: false })); // 判断请求体是不是json不是的话把请求体转化为对象 app.use(bodyParser.urlencoded({ extended: false })); // 判断请求体是不是json不是的话把请求体转化为对象
app.use(multer({ dest: 'tmp/' }).array('file'));//multer中间件用于上传表单型数据基本属性为dest会添加file对象到request对象中包含对象表单上传的文件信息 app.use(multer({ dest: 'tmp/' }).array('file'));//multer中间件用于上传表单型数据基本属性为dest会添加file对象到request对象中包含对象表单上传的文件信息
app.get('/',function (req,res) { app.get('/',function (req,res) {
res.sendfile(__dirname + "/public/" + "index.html" ); res.sendfile(__dirname + "/login.html" );
}) })
/*app.get('/',function(req,res){
res.sendFile(path.join(__dirname,"/login.html"))
//_dirname:当前文件的路径path.join():合并路径
})
/** /**
* 实现登录验证功能 * 实现登录验证功能
*/ */
var ppcookie = ''
var ppname = ''
var pppwd = ''
app.get('/login', function (req, res) { app.get('/login', function (req, res) {
var response = { var response = {
"name":req.query.name, "name":req.query.name,
"password":req.query.pwd, "password":req.query.pwd,
}; };
/*var selectSQL = "select * from UserInfoTest where User_Name = '" + name + "' and User_Password = '" + password + "'";*/ /*var selectSQL = "select * from UserInfoTest where User_Name = '" + name + "' and User_Password = '" + password + "'";*/
var selectSQL = "select User_Name,User_password from UserInfoTest where User_Name = '" + req.query.name + "' and User_Password = '" + req.query.pwd + "'"; var selectSQL = "select uname,pwd from user where uname = '" + req.query.name + "' and pwd = '" + req.query.pwd + "'";
connection.query(selectSQL, function (err, result) { connection.query(selectSQL, function (err, result) {
if (err) { if (err) {
console.log('[login ERROR] - ', err.message); console.log('[login ERROR] - ', err.message);
@ -48,9 +81,44 @@ app.get('/login', function (req, res) {
} }
else { else {
console.log(result); console.log(result);
console.log("OK"); console.log("OK"+'123');
ppname = req.query.name
res.redirect("/public/" + "ok.html");//重定向到网页 pppwd = req.query.pwd
// res.redirect("/public/" + "ok1.html")
// dummy = childProcess.spawn('python' ,['./tmp.py'] ,{cwd: path.resolve(__dirname, './')})
const ls = childProcess.spawn('python3' ,['./connect.py', '--ip','192.168.43.241', '--port','7777','login','--user',req.query.name,'--password',req.query.pwd],{cwd: path.resolve(__dirname, './')})
ls.stdout.on('data', function (data){
//console.log('sdjfksjdfklajklfdjalkjfklda')
//req.session.cookie = data.toString().trim();
var sess = req.session;
sess.regenerate(function(err){ //添加session信息
req.session.name = data.toString().trim();
req.session.user = req.query.name;
req.session.pwd = req.query.pwd;
})
var a = data.toString()
a = a.trim()
ppcookie = a
console.log(ppcookie);
var start = new Date();
setTimeout(function(){
console.log(req.session.name);
console.log(req.session.user);
console.log(req.session.pwd);
res.redirect("/public/" + "ok1.html")
},2000)
// console.log(a[]);
})
//execute('python tmp.py')
// execute('python connect.py --ip 10.129.16.173 --port 7777 login --user wufayuan --password 113818');
/* const ls = childProcess.spawn('python3' ,['connect.py', '--ip','192.168.43.241', '--port','7777','login','--user','wufayuan','--password','113818'],{cwd: path.resolve(__dirname, './')
})
ls.stdout.on('data', function(data){
sys.print(data);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});*/
} }
}); });
console.log(response); console.log(response);
@ -63,18 +131,18 @@ app.get('/login', function (req, res) {
res.sendfile(__dirname + "/public/" + "ok.html" ); res.sendfile(__dirname + "/public/" + "ok.html" );
}) })
})**/ })**/
app.get('/register.html',function (req,res) { app.get('/register.html',function (req,res) {
res.sendfile(__dirname+"/public/"+"register.html"); res.sendfile(__dirname+"/lndex.html");
}) })
/** /**
* 实现注册功能 * 实现注册功能
*/ */
app.get('/register',function (req,res) { app.get('/register',function (req,res) {
var name=req.query.name; var name=req.query.name;
var pwd = req.query.pwd; var pwd = req.query.pwd;
var selectSQL = "select User_Name,User_password from UserInfoTest where User_Name = '" + req.query.name+"'"; var selectSQL = "select uname,pwd from user where uname = '" + req.query.name+"'";
connection.query(selectSQL, function (err, result) { connection.query(selectSQL, function (err, result) {
if (err) { if (err) {
console.log('[login ERROR] - ', err.message); console.log('[login ERROR] - ', err.message);
@ -84,47 +152,70 @@ app.get('/register',function (req,res) {
res.send("The account exist!"); res.send("The account exist!");
} }
else { else {
var user = { User_Name: name, User_Password: pwd }; var user = { uname: name, pwd: pwd ,finame:NULL,email:NULL,phone:NULL};
connection.query('insert into UserInfoTest set ?', user, function (err, rs) { connection.query('insert into user set ?', user, function (err, rs) {
if (err) throw err; // if (err) throw err;
console.log('ok'); console.log('ok');
res.redirect("/public/" + "index.html"); res.redirect('login.html');
const ls = childProcess.spawn('python3' ,['./connect.py', '--ip','192.168.43.241', '--port','7777','register','--user',name,'--password',pwd],{cwd: path.resolve(__dirname, './')
})
}) })
} }
}) })
}) })
app.get('/ok.html',function (req,res) { app.get('/ok1.html',function (req,res) {
res.redirect("/public/"+"ok.html"); res.redirect("/public/"+"ok1.html");
}) })
var server=app.listen(3000,function () { /*var server=app.listen(3300,function () {
console.log("start"); console.log("start");
}) })*/
// 上传文件api //const express = require('express');
app.post('/file_upload', function (req, res) { const timeout = require('connect-timeout');
const { createProxyMiddleware } = require('http-proxy-middleware');
// HOST 指目标地址 PORT 服务端口
const HOST = 'http://192.168.43.64:7777', PORT = '3300';
// 超时时间
const TIME_OUT = 1000 * 1e3;
// 设置端口
app.set('port', PORT);
// 设置超时 返回超时响应
app.use(timeout(TIME_OUT));
app.use((req, res, next) => {
if (!req.timedout) next();
});
// 设置静态资源路径
app.use('/', express.static('static'));
// 反向代理(这里把需要进行反代的路径配置到这里即可)
// eg:将/api 代理到 ${HOST}/api
// app.use(createProxyMiddleware('/api', { target: HOST }));
// 自定义代理规则
app.use(createProxyMiddleware('/api', {
target: HOST, // target host
changeOrigin: true, // needed for virtual hosted sites
ws: true, // proxy websockets
pathRewrite: {
'^/api': '', // rewrite path
}
}));
// 监听端口
app.listen(app.get('port'), () => {
console.log(`server running ${PORT }`);
});
console.log(req.files[0]); // 上传的文件信息
var des_file = __dirname + "/0/" + req.files[0].originalname;
fs.readFile( req.files[0].path, function (err, data) {
fs.writeFile(des_file, data, function (err) {
if( err ){
console.log( err );
}else{
response = {
message:'File uploaded successfully',
filename:req.files[0].originalname
};
}
console.log( response );
res.end( JSON.stringify( response ) );
});
});
})
function execute(cmd) { //调用cmd命令 function execute(cmd) { //调用cmd命令
execSync(cmd, { cwd: './' }, function (error, stdout, stderr) { execSync(cmd, { cwd: './' }, function (error, stdout, stderr) {
@ -136,17 +227,154 @@ function execute(cmd) { //调用cmd命令
} }
}) })
} }
app.post('/check', function (req, res) { app.get('/check', function (req, res) {
execute('python connect.py --ip 127.0.0.1 --port 7777 crawling --word computer --cookie god --pages_start 1 --pages_end 4'); if(!!req.session.user){
fs.readFile('./result.json', 'utf-8', function (err, data) { var logo=req.query.logo;
if (err) { console.log(logo);
console.error(err); // console.log(ppcookie);
} a = ppcookie
else { console.log(a);
res.send(data); //const ls = childProcess.spawn('python3' ,['./connect.py','--word',logo,'--cookie',a])
} const ls = childProcess.spawn('python3' ,['./tmp.py','--ip','192.168.43.241','--port','7777','crawling','--word',logo,'--pages_start',1,'--pages_end',3,'--cookie',req.session.name])
}); ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
ls.on('close', function(code){
res.redirect("/tmmps.html")
})}
else{
res.send('未登录')
}
/*exec('python connect.py --ip 10.129.16.173 --port 7777 crawling --word '+logo +' --pages_start 1 --pages_end 3 --cookie '+a, {
// timeout: 0, // 超时时间
cwd: path.resolve(__dirname, './'), // 可以改变当前的执行路径
}, function (err, stdout, stderr) {
res.redirect("/tmmps.html")
return
// 执行结果
})*/
//execute('python connect.py --ip 192.168.43.64 --port 7777 crawling --word '+logo +' --pages_start 1 --pages_end 5 --cookie '+a);
//execute('python connect.py --ip 192.168.43.65 --port 7777 crawling --word computer --cookie b07f9e6461343a07635438925b0b93f9e0f9f084 --pages_start 1 --pages_end 3');
}) })
app.post('/cook', function (req, res) {
console.log(req.session.user);
res.redirect('/public/ok2.html');
})
app.post('/cook2', function (req, res) {
req.session.destroy(function(err) {
res.redirect('/login.html');
})
ppname = '0'
pppwd = '0'
})
app.get('/check1',function (req, res) {
console.log(req.session.user)
if(!!req.session.user){
const ls = childProcess.spawn('python3' ,['./ceshi03.py','--id',req.session.user],{cwd: path.resolve(__dirname, './')
})
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
ls.on('close', function(code){
res.redirect("/comment.html")
return;
})}
else{
res.send('未登录')
}
})
app.get('/std',function (req, res) {
if(!!req.session.user){
console.log(req.session.user);
var finame=req.query.finame;
var email = req.query.email;
var phone = req.query.phone;
var selectSQL = "select uname,pwd from user where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(selectSQL, function (err, result) {
console.log(req.session.user);
res.redirect('/public/ok1.html');
var user = {finame: finame,email:email, phone:phone};
sql = "update user set ? where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(sql, user, function (err, rs) {
// if (err) throw err;
console.log('ok');
})
})}
else{
res.send('未登录')
}
})
app.post('/std1',function (req, res) {
res.redirect('/public/ok3.html')
})
app.post('/std3',function (req, res) {
console.log('req.session.user');
var delSql = "DELETE FROM user_info where user_name = "+ req.session.user;
connection.query(delSql,function (err, result) {
if(err){
console.log('[DELETE ERROR] - ',err.message);
return;
}
});
var delSql1 = "DELETE FROM user where uname = "+ req.session.user;
connection.query(delSql1,function (err, result) {
if(err){
console.log('[DELETE ERROR] - ',err.message);
return;
//res.redirect('/login.html')
}
});
res.redirect('/login.html')
})
app.get('/std2',function (req, res) {
var pwd1=req.query.pwd1;
var pwd2=req.query.pwd2;
var pwd3=req.query.pwd3;
if(pwd3 != pwd2){
console.log("error")
res.send("两次输入的密码不一样");
}
if(pwd3 == pwd2){
var selectSQL = "select pwd from user where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(selectSQL, function (err, result) {
if (req.session.pwd != pwd1) {
res.send("当前密码输入错误");
console.log("error")
}
if(req.session.pwd == pwd1){
var user = {pwd:pwd2};
sql = "update user set ? where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(sql, user, function (err, rs) {
// if (err) throw err;
console.log('ok');
res.redirect('/public/ok1.html');
pppwd = pwd2
})
var user1 = {user_password:pwd2}
q = "update user_info set ? where user_name = '" + req.session.user + "' and user_password = '" + req.session.pwd + "'"
connection.query(q, user1, function (err, rs) {
// if (err) throw err;
console.log('ok');
//res.redirect('/public/ok1.html');
//pppwd = pwd2
})
}
})
}
})

@ -0,0 +1,372 @@
var express = require('express')
var path = require("path");
var mysql = require('mysql')
//var alert = require('alert')
//var router = express.Router()
var app = express()
const {get} = require('http')
const multer = require('multer')
var childProcess = require('child_process')
const bodyParser = require('body-parser')
const fs = require('fs')
//const document = require('document')
var jsdom = require("jsdom");
const { NULL } = require('mysql/lib/protocol/constants/types');
var JSDOM = jsdom.JSDOM;
var document = new JSDOM().window.document;
var execSync = require("child_process").execSync;
var sys = require('sys');
//var exec = require('child_process').exec
//const cp = require('child_process');
var session = require("express-session");
var FileStore = require('session-file-store')(session);
var identityKey = 'skey';
app.use(
session({
name: identityKey,
secret: "jhh",
store: new FileStore(), //加密存储
resave: false, //客户端并行请求是否覆盖
saveUninitialized: true, //初始化session存储
cookie: {
maxAge: 1000*60*10 // 这一条 是控制 sessionID 的过期时间的!!!
},
})
);
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.use(express.static('./'))
/**
* 配置MySql
*/
var connection = mysql.createConnection({
host : '192.168.43.64',
user : 'root',
password : '427318Aa',
database : 'test',
port:'3306'
});
connection.connect();
app.use('/public', express.static('public')); // 设置静态文件的中间件
app.use(bodyParser.urlencoded({ extended: false })); // 判断请求体是不是json不是的话把请求体转化为对象
app.use(multer({ dest: 'tmp/' }).array('file'));//multer中间件用于上传表单型数据基本属性为dest会添加file对象到request对象中包含对象表单上传的文件信息
app.get('/',function (req,res) {
res.sendfile(__dirname + "/login.html" );
})
/*app.get('/',function(req,res){
res.sendFile(path.join(__dirname,"/login.html"))
//_dirname:当前文件的路径path.join():合并路径
})
/**
* 实现登录验证功能
*/
var ppcookie = ''
var ppname = ''
var pppwd = ''
app.get('/login', function (req, res) {
var response = {
"name":req.query.name,
"password":req.query.pwd,
};
/*var selectSQL = "select * from UserInfoTest where User_Name = '" + name + "' and User_Password = '" + password + "'";*/
var selectSQL = "select uname,pwd from user where uname = '" + req.query.name + "' and pwd = '" + req.query.pwd + "'";
connection.query(selectSQL, function (err, result) {
if (err) {
console.log('[login ERROR] - ', err.message);
return;
}
if (result == '') {
console.log("帐号密码错误");
res.end("The account does not exist or the password is wrong!");
}
else {
console.log(result);
console.log("OK"+'123');
ppname = req.query.name
pppwd = req.query.pwd
// res.redirect("/public/" + "ok1.html")
// dummy = childProcess.spawn('python' ,['./tmp.py'] ,{cwd: path.resolve(__dirname, './')})
const ls = childProcess.spawn('python3' ,['./connect.py', '--ip','192.168.43.241', '--port','7777','login','--user',req.query.name,'--password',req.query.pwd],{cwd: path.resolve(__dirname, './')})
ls.stdout.on('data', function (data){
//console.log('sdjfksjdfklajklfdjalkjfklda')
//req.session.cookie = data.toString().trim();
var sess = req.session;
sess.regenerate(function(err){ //添加session信息
req.session.name = data.toString().trim();
req.session.user = req.query.name;
req.session.pwd = req.query.pwd;
})
var a = data.toString()
a = a.trim()
ppcookie = a
console.log(ppcookie);
var start = new Date();
setTimeout(function(){
console.log(req.session.name);
console.log(req.session.user);
console.log(req.session.pwd);
res.redirect("/public/" + "ok1.html")
},2000)
// console.log(a[]);
})
//execute('python tmp.py')
// execute('python connect.py --ip 10.129.16.173 --port 7777 login --user wufayuan --password 113818');
/* const ls = childProcess.spawn('python3' ,['connect.py', '--ip','192.168.43.241', '--port','7777','login','--user','wufayuan','--password','113818'],{cwd: path.resolve(__dirname, './')
})
ls.stdout.on('data', function(data){
sys.print(data);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});*/
}
});
console.log(response);
})
/**connection.query(selectSQL,function (err,rs) {
if (err) throw err;
console.log(rs);
console.log('OK');
res.sendfile(__dirname + "/public/" + "ok.html" );
})
})**/
app.get('/register.html',function (req,res) {
res.sendfile(__dirname+"/lndex.html");
})
/**
* 实现注册功能
*/
app.get('/register',function (req,res) {
var name=req.query.name;
var pwd = req.query.pwd;
var selectSQL = "select uname,pwd from user where uname = '" + req.query.name+"'";
connection.query(selectSQL, function (err, result) {
if (err) {
console.log('[login ERROR] - ', err.message);
return;
}
if (result.length) {
res.send("The account exist!");
}
else {
var user = { uname: name, pwd: pwd ,finame:NULL,email:NULL,phone:NULL};
connection.query('insert into user set ?', user, function (err, rs) {
// if (err) throw err;
console.log('ok');
res.redirect('login.html');
const ls = childProcess.spawn('python3' ,['./connect.py', '--ip','192.168.43.241', '--port','7777','register','--user',name,'--password',pwd],{cwd: path.resolve(__dirname, './')
})
})
}
})
})
app.get('/ok1.html',function (req,res) {
res.redirect("/public/"+"ok1.html");
})
var server=app.listen(3300,function () {
console.log("start");
})
//const express = require('express');
/*const timeout = require('connect-timeout');
const { createProxyMiddleware } = require('http-proxy-middleware');
// HOST 指目标地址 PORT 服务端口
const HOST = 'http://192.168.43.64:7777', PORT = '3300';
// 超时时间
const TIME_OUT = 1000 * 1e3;
// 设置端口
app.set('port', PORT);
// 设置超时 返回超时响应
app.use(timeout(TIME_OUT));
app.use((req, res, next) => {
if (!req.timedout) next();
});
// 设置静态资源路径
app.use('/', express.static('static'));
// 反向代理(这里把需要进行反代的路径配置到这里即可)
// eg:将/api 代理到 ${HOST}/api
// app.use(createProxyMiddleware('/api', { target: HOST }));
// 自定义代理规则
app.use(createProxyMiddleware('/api', {
target: HOST, // target host
changeOrigin: true, // needed for virtual hosted sites
ws: true, // proxy websockets
pathRewrite: {
'^/api': '', // rewrite path
}
}));
// 监听端口
app.listen(app.get('port'), () => {
console.log(`server running ${PORT }`);
});*/
function execute(cmd) { //调用cmd命令
execSync(cmd, { cwd: './' }, function (error, stdout, stderr) {
if (error) {
console.error(error);
}
else {
console.log("executing success!")
}
})
}
app.get('/check', function (req, res) {
if(!!req.session.user){
var logo=req.query.logo;
console.log(logo);
// console.log(ppcookie);
a = ppcookie
console.log(a);
//const ls = childProcess.spawn('python3' ,['./connect.py','--word',logo,'--cookie',a])
const ls = childProcess.spawn('python3' ,['./tmp.py','--ip','192.168.43.241','--port','7777','crawling','--word',logo,'--pages_start',1,'--pages_end',3,'--cookie',req.session.name])
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
ls.on('close', function(code){
res.redirect("/tmmps.html")
})}
else{
res.send('未登录')
}
/*exec('python connect.py --ip 10.129.16.173 --port 7777 crawling --word '+logo +' --pages_start 1 --pages_end 3 --cookie '+a, {
// timeout: 0, // 超时时间
cwd: path.resolve(__dirname, './'), // 可以改变当前的执行路径
}, function (err, stdout, stderr) {
res.redirect("/tmmps.html")
return
// 执行结果
})*/
//execute('python connect.py --ip 192.168.43.64 --port 7777 crawling --word '+logo +' --pages_start 1 --pages_end 5 --cookie '+a);
//execute('python connect.py --ip 192.168.43.65 --port 7777 crawling --word computer --cookie b07f9e6461343a07635438925b0b93f9e0f9f084 --pages_start 1 --pages_end 3');
})
app.post('/cook', function (req, res) {
console.log(req.session.user);
res.redirect('/public/ok2.html');
})
app.post('/cook2', function (req, res) {
req.session.destroy(function(err) {
res.redirect('/login.html');
})
ppname = '0'
pppwd = '0'
})
app.get('/check1',function (req, res) {
console.log(req.session.user)
if(!!req.session.user){
const ls = childProcess.spawn('python3' ,['./ceshi03.py','--id',req.session.user],{cwd: path.resolve(__dirname, './')
})
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
ls.on('close', function(code){
res.redirect("/comment.html")
return;
})}
else{
res.send('未登录')
}
})
app.get('/std',function (req, res) {
if(!!req.session.user){
console.log(req.session.user);
var finame=req.query.finame;
var email = req.query.email;
var phone = req.query.phone;
var selectSQL = "select uname,pwd from user where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(selectSQL, function (err, result) {
console.log(req.session.user);
res.redirect('/public/ok1.html');
var user = {finame: finame,email:email, phone:phone};
sql = "update user set ? where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(sql, user, function (err, rs) {
// if (err) throw err;
console.log('ok');
})
})}
else{
res.send('未登录')
}
})
app.post('/std1',function (req, res) {
res.redirect('/public/ok3.html')
})
app.post('/std3',function (req, res) {
var delSql = "DELETE FROM user_info where user_name = '"+ ppname;
connection.query(delSql,function (err, result) {
if(err){
console.log('[DELETE ERROR] - ',err.message);
return;
}
});
res.redirect('/public/ok3.html')
})
app.get('/std2',function (req, res) {
var pwd1=req.query.pwd1;
var pwd2=req.query.pwd2;
var pwd3=req.query.pwd3;
if(pwd3 != pwd2){
console.log("error")
res.send("两次输入的密码不一样");
}
if(pwd3 == pwd2){
var selectSQL = "select pwd from user where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(selectSQL, function (err, result) {
if (req.session.pwd != pwd1) {
res.send("当前密码输入错误");
console.log("error")
}
if(req.session.pwd == pwd1){
var user = {pwd:pwd2};
sql = "update user set ? where uname = '" + req.session.user + "' and pwd = '" + req.session.pwd + "'"
connection.query(sql, user, function (err, rs) {
// if (err) throw err;
console.log('ok');
res.redirect('/public/ok1.html');
pppwd = pwd2
})
var user1 = {user_password:pwd2}
q = "update user_info set ? where user_name = '" + req.session.user + "' and user_password = '" + req.session.pwd + "'"
connection.query(q, user1, function (err, rs) {
// if (err) throw err;
console.log('ok');
//res.redirect('/public/ok1.html');
//pppwd = pwd2
})
}
})
}
})

@ -0,0 +1,349 @@
var express = require('express')
var path = require("path");
var mysql = require('mysql')
var alert = require('alert')
var router = express.Router()
var app = express()
const {get} = require('http')
const multer = require('multer')
var childProcess = require('child_process')
const bodyParser = require('body-parser')
const fs = require('fs')
app.use(express.static('./'))
//const document = require('document')
var jsdom = require("jsdom");
const { NULL } = require('mysql/lib/protocol/constants/types');
var JSDOM = jsdom.JSDOM;
var document = new JSDOM().window.document;
var execSync = require("child_process").execSync;
var sys = require('sys');
var exec = require('child_process').exec
const cp = require('child_process');
/**
* 配置MySql
*/
var connection = mysql.createConnection({
host : '10.129.16.173',
user : 'root',
password : '427318Aa',
database : 'test',
port:'3306'
});
connection.connect();
app.use('/public', express.static('public')); // 设置静态文件的中间件
app.use(bodyParser.urlencoded({ extended: false })); // 判断请求体是不是json不是的话把请求体转化为对象
app.use(multer({ dest: 'tmp/' }).array('file'));//multer中间件用于上传表单型数据基本属性为dest会添加file对象到request对象中包含对象表单上传的文件信息
app.get('/',function (req,res) {
res.sendfile(__dirname + "/login.html" );
})
/*app.get('/',function(req,res){
res.sendFile(path.join(__dirname,"/login.html"))
//_dirname:当前文件的路径path.join():合并路径
})
/**
* 实现登录验证功能
*/
var ppcookie = ''
var ppname = ''
var pppwd = ''
app.get('/login', function (req, res) {
var response = {
"name":req.query.name,
"password":req.query.pwd,
};
/*var selectSQL = "select * from UserInfoTest where User_Name = '" + name + "' and User_Password = '" + password + "'";*/
var selectSQL = "select uname,pwd from user where uname = '" + req.query.name + "' and pwd = '" + req.query.pwd + "'";
connection.query(selectSQL, function (err, result) {
if (err) {
console.log('[login ERROR] - ', err.message);
return;
}
if (result == '') {
console.log("帐号密码错误");
res.end("The account does not exist or the password is wrong!");
}
else {
console.log(result);
console.log("OK"+'123');
ppname = req.query.name
pppwd = req.query.pwd
res.redirect("/public/" + "ok1.html");//重定向到网页
// dummy = childProcess.spawn('python' ,['./tmp.py'] ,{cwd: path.resolve(__dirname, './')})
const ls = childProcess.spawn('python3' ,['./connect2.py', '--ip','10.129.16.173', '--port','7777','login','--user',req.query.name,'--password',req.query.pwd],{cwd: path.resolve(__dirname, './')})
ls.stdout.on('data', function (data){
//console.log('sdjfksjdfklajklfdjalkjfklda')
var a = data.toString()
a = a.trim()
ppcookie = a
console.log(ppcookie);
// console.log(a[]);
})
//execute('python tmp.py')
// execute('python connect.py --ip 10.129.16.173 --port 7777 login --user wufayuan --password 113818');
/* const ls = childProcess.spawn('python3' ,['connect.py', '--ip','192.168.43.241', '--port','7777','login','--user','wufayuan','--password','113818'],{cwd: path.resolve(__dirname, './')
})
ls.stdout.on('data', function(data){
sys.print(data);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});*/
}
});
console.log(response);
})
/**connection.query(selectSQL,function (err,rs) {
if (err) throw err;
console.log(rs);
console.log('OK');
res.sendfile(__dirname + "/public/" + "ok.html" );
})
})**/
app.get('/register.html',function (req,res) {
res.sendfile(__dirname+"/lndex.html");
})
/**
* 实现注册功能
*/
app.get('/register',function (req,res) {
var name=req.query.name;
var pwd = req.query.pwd;
var selectSQL = "select uname,pwd from user where uname = '" + req.query.name+"'";
connection.query(selectSQL, function (err, result) {
if (err) {
console.log('[login ERROR] - ', err.message);
return;
}
if (result.length) {
res.send("The account exist!");
}
else {
var user = { uname: name, pwd: pwd ,finame:NULL,email:NULL,phone:NULL};
connection.query('insert into user set ?', user, function (err, rs) {
// if (err) throw err;
console.log('ok');
res.redirect('login.html');
const ls = childProcess.spawn('python3' ,['./connect2.py', '--ip','10.129.16.173', '--port','7777','register','--user',name,'--password',pwd],{cwd: path.resolve(__dirname, './')
})
})
}
})
})
app.get('/ok1.html',function (req,res) {
res.redirect("/public/"+"ok1.html");
})
var server=app.listen(3300,function () {
console.log("start");
})
//const express = require('express');
/*const timeout = require('connect-timeout');
const { createProxyMiddleware } = require('http-proxy-middleware');
// HOST 指目标地址 PORT 服务端口
const HOST = 'http://10.129.77.113:7777', PORT = '3300';
// 超时时间
const TIME_OUT = 30 * 1e3;
// 设置端口
app.set('port', PORT);
// 设置超时 返回超时响应
app.use(timeout(TIME_OUT));
app.use((req, res, next) => {
if (!req.timedout) next();
});
// 设置静态资源路径
app.use('/', express.static('static'));
// 反向代理(这里把需要进行反代的路径配置到这里即可)
// eg:将/api 代理到 ${HOST}/api
// app.use(createProxyMiddleware('/api', { target: HOST }));
// 自定义代理规则
app.use(createProxyMiddleware('/api', {
target: HOST, // target host
changeOrigin: true, // needed for virtual hosted sites
ws: true, // proxy websockets
pathRewrite: {
'^/api': '', // rewrite path
}
}));
// 监听端口
app.listen(app.get('port'), () => {
console.log(`server running ${PORT }`);
});*/
// 上传文件api
app.post('/file_upload', function (req, res) {
console.log(req.files[0]); // 上传的文件信息
var des_file = __dirname + "/0/" + req.files[0].originalname;
fs.readFile( req.files[0].path, function (err, data) {
fs.writeFile(des_file, data, function (err) {
if( err ){
console.log( err );
}else{
response = {
message:'File uploaded successfully',
filename:req.files[0].originalname
};
}
console.log( response );
res.end( JSON.stringify( response ) );
});
});
})
function execute(cmd) { //调用cmd命令
execSync(cmd, { cwd: './' }, function (error, stdout, stderr) {
if (error) {
console.error(error);
}
else {
console.log("executing success!")
}
})
}
app.get('/check', function (req, res) {
var logo=req.query.logo;
console.log(logo);
// console.log(ppcookie);
a = ppcookie
console.log(a);
//const ls = childProcess.spawn('python3' ,['./connect.py','--word',logo,'--cookie',a])
const ls = childProcess.spawn('python3' ,['./connect1.py','--ip','10.129.16.173','--port','7777','crawling','--word',logo,'--pages_start',1,'--pages_end',3,'--cookie',a])
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
ls.on('close', function(code){
res.redirect("/tmmps.html")
})
/*exec('python connect.py --ip 10.129.16.173 --port 7777 crawling --word '+logo +' --pages_start 1 --pages_end 3 --cookie '+a, {
// timeout: 0, // 超时时间
cwd: path.resolve(__dirname, './'), // 可以改变当前的执行路径
}, function (err, stdout, stderr) {
res.redirect("/tmmps.html")
return
// 执行结果
})*/
//execute('python connect.py --ip 192.168.43.64 --port 7777 crawling --word '+logo +' --pages_start 1 --pages_end 5 --cookie '+a);
//execute('python connect.py --ip 192.168.43.65 --port 7777 crawling --word computer --cookie b07f9e6461343a07635438925b0b93f9e0f9f084 --pages_start 1 --pages_end 3');
})
app.post('/cook', function (req, res) {
res.redirect('/public/ok2.html');
})
app.post('/cook2', function (req, res) {
res.redirect('/login.html');
ppname = '0'
pppwd = '0'
})
app.post('/check1',function (req, res) {
if(ppname != '0'){
const ls = childProcess.spawn('python3' ,['./ceshi03.py','--id',ppname],{cwd: path.resolve(__dirname, './')
})
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
ls.on('close', function(code){
res.redirect("/comment.html")
return;
})}
else{
res.send('未登录')
}
})
app.get('/std',function (req, res) {
var finame=req.query.finame;
var email = req.query.email;
var phone = req.query.phone;
var selectSQL = "select uname,pwd from user where uname = '" + ppname + "' and pwd = '" + pppwd + "'"
connection.query(selectSQL, function (err, result) {
var user = {finame: finame,email:email, phone:phone};
sql = "update user set ? where uname = '" + ppname + "' and pwd = '" + pppwd + "'"
connection.query(sql, user, function (err, rs) {
// if (err) throw err;
console.log('ok');
res.redirect('/public/ok1.html');
})
})
})
app.post('/std1',function (req, res) {
res.redirect('/public/ok3.html')
})
app.post('/std3',function (req, res) {
var delSql = "DELETE FROM user_info where user_name = '"+ ppname;
connection.query(delSql,function (err, result) {
if(err){
console.log('[DELETE ERROR] - ',err.message);
return;
}
});
res.redirect('/public/ok3.html')
})
app.get('/std2',function (req, res) {
var pwd1=req.query.pwd1;
var pwd2=req.query.pwd2;
var pwd3=req.query.pwd3;
if(pwd3 != pwd2){
console.log("error")
res.send("两次输入的密码不一样");
}
if(pwd3 == pwd2){
var selectSQL = "select pwd from user where uname = '" + ppname + "' and pwd = '" + pppwd + "'"
connection.query(selectSQL, function (err, result) {
if (pppwd != pwd1) {
res.send("当前密码输入错误");
console.log("error")
}
if(pppwd == pwd1){
var user = {pwd:pwd2};
sql = "update user set ? where uname = '" + ppname + "' and pwd = '" + pppwd + "'"
connection.query(sql, user, function (err, rs) {
// if (err) throw err;
console.log('ok');
res.redirect('/public/ok1.html');
pppwd = pwd2
})
var user1 = {user_password:pwd2}
q = "update user_info set ? where user_name = '" + ppname + "' and user_password = '" + pppwd + "'"
connection.query(q, user1, function (err, rs) {
// if (err) throw err;
console.log('ok');
//res.redirect('/public/ok1.html');
//pppwd = pwd2
})
}
})
}
})

674
ui/node_modules/.package-lock.json generated vendored

@ -1,15 +1,31 @@
{ {
"name": "lxy", "name": "ui",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"node_modules/@types/http-proxy": {
"version": "1.17.9",
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz",
"integrity": "sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node": {
"version": "18.0.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.1.tgz",
"integrity": "sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==",
"dev": true
},
"node_modules/accepts": { "node_modules/accepts": {
"version": "1.3.7", "version": "1.3.8",
"resolved": "https://registry.nlark.com/accepts/download/accepts-1.3.7.tgz", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
"integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
"dev": true,
"dependencies": { "dependencies": {
"mime-types": "~2.1.24", "mime-types": "~2.1.34",
"negotiator": "0.6.2" "negotiator": "0.6.3"
}, },
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
@ -23,7 +39,8 @@
"node_modules/array-flatten": { "node_modules/array-flatten": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.nlark.com/array-flatten/download/array-flatten-1.1.1.tgz", "resolved": "https://registry.nlark.com/array-flatten/download/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
"dev": true
}, },
"node_modules/bignumber.js": { "node_modules/bignumber.js": {
"version": "9.0.0", "version": "9.0.0",
@ -34,25 +51,59 @@
} }
}, },
"node_modules/body-parser": { "node_modules/body-parser": {
"version": "1.19.1", "version": "1.20.0",
"resolved": "https://registry.npmmirror.com/body-parser/download/body-parser-1.19.1.tgz", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
"integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==", "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
"dependencies": { "dependencies": {
"bytes": "3.1.1", "bytes": "3.1.2",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "2.0.0",
"http-errors": "1.8.1", "destroy": "1.2.0",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24", "iconv-lite": "0.4.24",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"qs": "6.9.6", "qs": "6.10.3",
"raw-body": "2.4.2", "raw-body": "2.5.1",
"type-is": "~1.6.18" "type-is": "~1.6.18",
"unpipe": "1.0.0"
},
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/body-parser/node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/body-parser/node_modules/on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"dependencies": {
"ee-first": "1.1.1"
}, },
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"dependencies": {
"fill-range": "^7.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/buffer-from": { "node_modules/buffer-from": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.nlark.com/buffer-from/download/buffer-from-1.1.2.tgz", "resolved": "https://registry.nlark.com/buffer-from/download/buffer-from-1.1.2.tgz",
@ -71,13 +122,25 @@
} }
}, },
"node_modules/bytes": { "node_modules/bytes": {
"version": "3.1.1", "version": "3.1.2",
"resolved": "https://registry.npmmirror.com/bytes/download/bytes-3.1.1.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
"integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dependencies": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/concat-stream": { "node_modules/concat-stream": {
"version": "1.6.2", "version": "1.6.2",
"resolved": "https://registry.nlark.com/concat-stream/download/concat-stream-1.6.2.tgz", "resolved": "https://registry.nlark.com/concat-stream/download/concat-stream-1.6.2.tgz",
@ -119,10 +182,53 @@
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"
} }
}, },
"node_modules/connect-timeout": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/connect-timeout/-/connect-timeout-1.9.0.tgz",
"integrity": "sha512-q4bsBIPd+eSGtnh/u6EBOKfuG+4YvwsN0idlOsg6KAw71Qpi0DCf2eCc/Va63QU9qdOeYC8katxoC+rHMNygZg==",
"dev": true,
"dependencies": {
"http-errors": "~1.6.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"on-headers": "~1.0.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/connect-timeout/node_modules/http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==",
"dev": true,
"dependencies": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/connect-timeout/node_modules/inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==",
"dev": true
},
"node_modules/connect-timeout/node_modules/setprototypeof": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==",
"dev": true
},
"node_modules/content-disposition": { "node_modules/content-disposition": {
"version": "0.5.4", "version": "0.5.4",
"resolved": "https://registry.npmmirror.com/content-disposition/download/content-disposition-0.5.4.tgz", "resolved": "https://registry.npmmirror.com/content-disposition/download/content-disposition-0.5.4.tgz",
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
"dev": true,
"dependencies": { "dependencies": {
"safe-buffer": "5.2.1" "safe-buffer": "5.2.1"
}, },
@ -133,7 +239,8 @@
"node_modules/content-disposition/node_modules/safe-buffer": { "node_modules/content-disposition/node_modules/safe-buffer": {
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.2.1.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.2.1.tgz", "resolved": "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.2.1.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.2.1.tgz",
"integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=" "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=",
"dev": true
}, },
"node_modules/content-type": { "node_modules/content-type": {
"version": "1.0.4", "version": "1.0.4",
@ -144,9 +251,10 @@
} }
}, },
"node_modules/cookie": { "node_modules/cookie": {
"version": "0.4.1", "version": "0.5.0",
"resolved": "https://registry.nlark.com/cookie/download/cookie-0.4.1.tgz", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha1-r9cT/ibr0hupXOth+agRblClN9E=", "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
@ -154,7 +262,8 @@
"node_modules/cookie-signature": { "node_modules/cookie-signature": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.nlark.com/cookie-signature/download/cookie-signature-1.0.6.tgz", "resolved": "https://registry.nlark.com/cookie-signature/download/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=",
"dev": true
}, },
"node_modules/core-util-is": { "node_modules/core-util-is": {
"version": "1.0.3", "version": "1.0.3",
@ -173,14 +282,19 @@
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.nlark.com/depd/download/depd-1.1.2.tgz", "resolved": "https://registry.nlark.com/depd/download/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/destroy": { "node_modules/destroy": {
"version": "1.0.4", "version": "1.2.0",
"resolved": "https://registry.nlark.com/destroy/download/destroy-1.0.4.tgz", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
}, },
"node_modules/dicer": { "node_modules/dicer": {
"version": "0.2.5", "version": "0.2.5",
@ -201,25 +315,34 @@
}, },
"node_modules/encodeurl": { "node_modules/encodeurl": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.nlark.com/encodeurl/download/encodeurl-1.0.2.tgz", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/escape-html": { "node_modules/escape-html": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.nlark.com/escape-html/download/escape-html-1.0.3.tgz", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
"dev": true
}, },
"node_modules/etag": { "node_modules/etag": {
"version": "1.8.1", "version": "1.8.1",
"resolved": "https://registry.nlark.com/etag/download/etag-1.8.1.tgz", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/eventemitter3": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
"dev": true
},
"node_modules/execute": { "node_modules/execute": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmmirror.com/execute/download/execute-0.1.0.tgz", "resolved": "https://registry.npmmirror.com/execute/download/execute-0.1.0.tgz",
@ -229,37 +352,39 @@
} }
}, },
"node_modules/express": { "node_modules/express": {
"version": "4.17.2", "version": "4.18.1",
"resolved": "https://registry.npmmirror.com/express/download/express-4.17.2.tgz", "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz",
"integrity": "sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==", "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==",
"dev": true,
"dependencies": { "dependencies": {
"accepts": "~1.3.7", "accepts": "~1.3.8",
"array-flatten": "1.1.1", "array-flatten": "1.1.1",
"body-parser": "1.19.1", "body-parser": "1.20.0",
"content-disposition": "0.5.4", "content-disposition": "0.5.4",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"cookie": "0.4.1", "cookie": "0.5.0",
"cookie-signature": "1.0.6", "cookie-signature": "1.0.6",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "2.0.0",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"etag": "~1.8.1", "etag": "~1.8.1",
"finalhandler": "~1.1.2", "finalhandler": "1.2.0",
"fresh": "0.5.2", "fresh": "0.5.2",
"http-errors": "2.0.0",
"merge-descriptors": "1.0.1", "merge-descriptors": "1.0.1",
"methods": "~1.1.2", "methods": "~1.1.2",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"path-to-regexp": "0.1.7", "path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.7", "proxy-addr": "~2.0.7",
"qs": "6.9.6", "qs": "6.10.3",
"range-parser": "~1.2.1", "range-parser": "~1.2.1",
"safe-buffer": "5.2.1", "safe-buffer": "5.2.1",
"send": "0.17.2", "send": "0.18.0",
"serve-static": "1.14.2", "serve-static": "1.15.0",
"setprototypeof": "1.2.0", "setprototypeof": "1.2.0",
"statuses": "~1.5.0", "statuses": "2.0.1",
"type-is": "~1.6.18", "type-is": "~1.6.18",
"utils-merge": "1.0.1", "utils-merge": "1.0.1",
"vary": "~1.1.2" "vary": "~1.1.2"
@ -268,63 +393,244 @@
"node": ">= 0.10.0" "node": ">= 0.10.0"
} }
}, },
"node_modules/express/node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"dev": true,
"engines": {
"node": ">= 0.8"
}
},
"node_modules/express/node_modules/on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"dev": true,
"dependencies": {
"ee-first": "1.1.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/express/node_modules/safe-buffer": { "node_modules/express/node_modules/safe-buffer": {
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.2.1.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.2.1.tgz", "resolved": "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.2.1.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.2.1.tgz",
"integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=" "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=",
"dev": true
},
"node_modules/express/node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"dev": true,
"engines": {
"node": ">= 0.8"
}
},
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
}, },
"node_modules/finalhandler": { "node_modules/finalhandler": {
"version": "1.1.2", "version": "1.2.0",
"resolved": "https://registry.nlark.com/finalhandler/download/finalhandler-1.1.2.tgz", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
"integrity": "sha1-t+fQAP/RGTjQ/bBTUG9uur6fWH0=", "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
"dev": true,
"dependencies": { "dependencies": {
"debug": "2.6.9", "debug": "2.6.9",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"statuses": "~1.5.0", "statuses": "2.0.1",
"unpipe": "~1.0.0" "unpipe": "~1.0.0"
}, },
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/finalhandler/node_modules/on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"dev": true,
"dependencies": {
"ee-first": "1.1.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/finalhandler/node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"dev": true,
"engines": {
"node": ">= 0.8"
}
},
"node_modules/follow-redirects": {
"version": "1.15.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
"integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/forwarded": { "node_modules/forwarded": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.nlark.com/forwarded/download/forwarded-0.2.0.tgz?cache=0&sync_timestamp=1622503508967&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fforwarded%2Fdownload%2Fforwarded-0.2.0.tgz", "resolved": "https://registry.nlark.com/forwarded/download/forwarded-0.2.0.tgz?cache=0&sync_timestamp=1622503508967&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fforwarded%2Fdownload%2Fforwarded-0.2.0.tgz",
"integrity": "sha1-ImmTZCiq1MFcfr6XeahL8LKoGBE=", "integrity": "sha1-ImmTZCiq1MFcfr6XeahL8LKoGBE=",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/fresh": { "node_modules/fresh": {
"version": "0.5.2", "version": "0.5.2",
"resolved": "https://registry.nlark.com/fresh/download/fresh-0.5.2.tgz", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"node_modules/get-intrinsic": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
"integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
"dependencies": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.3"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dependencies": {
"function-bind": "^1.1.1"
},
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/has-symbols": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/http-errors": { "node_modules/http-errors": {
"version": "1.8.1", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/http-errors/download/http-errors-1.8.1.tgz", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
"integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
"dependencies": { "dependencies": {
"depd": "~1.1.2", "depd": "2.0.0",
"inherits": "2.0.4", "inherits": "2.0.4",
"setprototypeof": "1.2.0", "setprototypeof": "1.2.0",
"statuses": ">= 1.5.0 < 2", "statuses": "2.0.1",
"toidentifier": "1.0.1" "toidentifier": "1.0.1"
}, },
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.8"
}
},
"node_modules/http-errors/node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/http-errors/node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/http-proxy": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
"dev": true,
"dependencies": {
"eventemitter3": "^4.0.0",
"follow-redirects": "^1.0.0",
"requires-port": "^1.0.0"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/http-proxy-middleware": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz",
"integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==",
"dev": true,
"dependencies": {
"@types/http-proxy": "^1.17.8",
"http-proxy": "^1.18.1",
"is-glob": "^4.0.1",
"is-plain-obj": "^3.0.0",
"micromatch": "^4.0.2"
},
"engines": {
"node": ">=12.0.0"
},
"peerDependencies": {
"@types/express": "^4.17.13"
},
"peerDependenciesMeta": {
"@types/express": {
"optional": true
}
} }
}, },
"node_modules/iconv-lite": { "node_modules/iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.nlark.com/iconv-lite/download/iconv-lite-0.4.24.tgz?cache=0&sync_timestamp=1621826342262&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"dependencies": { "dependencies": {
"safer-buffer": ">= 2.1.2 < 3" "safer-buffer": ">= 2.1.2 < 3"
}, },
@ -341,10 +647,53 @@
"version": "1.9.1", "version": "1.9.1",
"resolved": "https://registry.nlark.com/ipaddr.js/download/ipaddr.js-1.9.1.tgz", "resolved": "https://registry.nlark.com/ipaddr.js/download/ipaddr.js-1.9.1.tgz",
"integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM=", "integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM=",
"dev": true,
"engines": { "engines": {
"node": ">= 0.10" "node": ">= 0.10"
} }
}, },
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/is-plain-obj": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz",
"integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/isarray": { "node_modules/isarray": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npm.taobao.org/isarray/download/isarray-0.0.1.tgz", "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-0.0.1.tgz",
@ -366,20 +715,36 @@
"node_modules/merge-descriptors": { "node_modules/merge-descriptors": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.nlark.com/merge-descriptors/download/merge-descriptors-1.0.1.tgz", "resolved": "https://registry.nlark.com/merge-descriptors/download/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=",
"dev": true
}, },
"node_modules/methods": { "node_modules/methods": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.nlark.com/methods/download/methods-1.1.2.tgz", "resolved": "https://registry.nlark.com/methods/download/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/micromatch": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
"dev": true,
"dependencies": {
"braces": "^3.0.2",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/mime": { "node_modules/mime": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmmirror.com/mime/download/mime-1.6.0.tgz", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"dev": true,
"bin": { "bin": {
"mime": "cli.js" "mime": "cli.js"
}, },
@ -487,9 +852,10 @@
} }
}, },
"node_modules/negotiator": { "node_modules/negotiator": {
"version": "0.6.2", "version": "0.6.3",
"resolved": "https://registry.nlark.com/negotiator/download/negotiator-0.6.2.tgz", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs=", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
@ -502,6 +868,14 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/object-inspect": {
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
"integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/on-finished": { "node_modules/on-finished": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.nlark.com/on-finished/download/on-finished-2.3.0.tgz", "resolved": "https://registry.nlark.com/on-finished/download/on-finished-2.3.0.tgz",
@ -513,10 +887,20 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/on-headers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
"integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
"dev": true,
"engines": {
"node": ">= 0.8"
}
},
"node_modules/parseurl": { "node_modules/parseurl": {
"version": "1.3.3", "version": "1.3.3",
"resolved": "https://registry.nlark.com/parseurl/download/parseurl-1.3.3.tgz", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ=", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }
@ -524,7 +908,20 @@
"node_modules/path-to-regexp": { "node_modules/path-to-regexp": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.nlark.com/path-to-regexp/download/path-to-regexp-0.1.7.tgz", "resolved": "https://registry.nlark.com/path-to-regexp/download/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=",
"dev": true
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
}, },
"node_modules/process-nextick-args": { "node_modules/process-nextick-args": {
"version": "2.0.1", "version": "2.0.1",
@ -535,6 +932,7 @@
"version": "2.0.7", "version": "2.0.7",
"resolved": "https://registry.nlark.com/proxy-addr/download/proxy-addr-2.0.7.tgz", "resolved": "https://registry.nlark.com/proxy-addr/download/proxy-addr-2.0.7.tgz",
"integrity": "sha1-8Z/mnOqzEe65S0LnDowgcPm6ECU=", "integrity": "sha1-8Z/mnOqzEe65S0LnDowgcPm6ECU=",
"dev": true,
"dependencies": { "dependencies": {
"forwarded": "0.2.0", "forwarded": "0.2.0",
"ipaddr.js": "1.9.1" "ipaddr.js": "1.9.1"
@ -544,28 +942,35 @@
} }
}, },
"node_modules/qs": { "node_modules/qs": {
"version": "6.9.6", "version": "6.10.3",
"resolved": "https://registry.npmmirror.com/qs/download/qs-6.9.6.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==", "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"dependencies": {
"side-channel": "^1.0.4"
},
"engines": { "engines": {
"node": ">=0.6" "node": ">=0.6"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/range-parser": { "node_modules/range-parser": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.nlark.com/range-parser/download/range-parser-1.2.1.tgz", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE=", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/raw-body": { "node_modules/raw-body": {
"version": "2.4.2", "version": "2.5.1",
"resolved": "https://registry.npmmirror.com/raw-body/download/raw-body-2.4.2.tgz?cache=0&sync_timestamp=1637116848060&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fraw-body%2Fdownload%2Fraw-body-2.4.2.tgz", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
"integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==", "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
"dependencies": { "dependencies": {
"bytes": "3.1.1", "bytes": "3.1.2",
"http-errors": "1.8.1", "http-errors": "2.0.0",
"iconv-lite": "0.4.24", "iconv-lite": "0.4.24",
"unpipe": "1.0.0" "unpipe": "1.0.0"
}, },
@ -584,6 +989,12 @@
"string_decoder": "~0.10.x" "string_decoder": "~0.10.x"
} }
}, },
"node_modules/requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
"dev": true
},
"node_modules/safe-buffer": { "node_modules/safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.1.2.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.1.2.tgz", "resolved": "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.1.2.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.1.2.tgz",
@ -591,46 +1002,79 @@
}, },
"node_modules/safer-buffer": { "node_modules/safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.nlark.com/safer-buffer/download/safer-buffer-2.1.2.tgz", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"node_modules/send": { "node_modules/send": {
"version": "0.17.2", "version": "0.18.0",
"resolved": "https://registry.npmmirror.com/send/download/send-0.17.2.tgz", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
"integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
"dev": true,
"dependencies": { "dependencies": {
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "2.0.0",
"destroy": "~1.0.4", "destroy": "1.2.0",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"etag": "~1.8.1", "etag": "~1.8.1",
"fresh": "0.5.2", "fresh": "0.5.2",
"http-errors": "1.8.1", "http-errors": "2.0.0",
"mime": "1.6.0", "mime": "1.6.0",
"ms": "2.1.3", "ms": "2.1.3",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"range-parser": "~1.2.1", "range-parser": "~1.2.1",
"statuses": "~1.5.0" "statuses": "2.0.1"
}, },
"engines": { "engines": {
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/send/node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"dev": true,
"engines": {
"node": ">= 0.8"
}
},
"node_modules/send/node_modules/ms": { "node_modules/send/node_modules/ms": {
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmmirror.com/ms/download/ms-2.1.3.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha1-V0yBOM4dK1hh8LRFedut1gxmFbI=" "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"dev": true
},
"node_modules/send/node_modules/on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"dev": true,
"dependencies": {
"ee-first": "1.1.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/send/node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"dev": true,
"engines": {
"node": ">= 0.8"
}
}, },
"node_modules/serve-static": { "node_modules/serve-static": {
"version": "1.14.2", "version": "1.15.0",
"resolved": "https://registry.npmmirror.com/serve-static/download/serve-static-1.14.2.tgz", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
"integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
"dev": true,
"dependencies": { "dependencies": {
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"send": "0.17.2" "send": "0.18.0"
}, },
"engines": { "engines": {
"node": ">= 0.8.0" "node": ">= 0.8.0"
@ -641,6 +1085,19 @@
"resolved": "https://registry.nlark.com/setprototypeof/download/setprototypeof-1.2.0.tgz", "resolved": "https://registry.nlark.com/setprototypeof/download/setprototypeof-1.2.0.tgz",
"integrity": "sha1-ZsmiSnP5/CjL5msJ/tPTPcrxtCQ=" "integrity": "sha1-ZsmiSnP5/CjL5msJ/tPTPcrxtCQ="
}, },
"node_modules/side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dependencies": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/sqlstring": { "node_modules/sqlstring": {
"version": "2.3.1", "version": "2.3.1",
"resolved": "https://registry.npm.taobao.org/sqlstring/download/sqlstring-2.3.1.tgz", "resolved": "https://registry.npm.taobao.org/sqlstring/download/sqlstring-2.3.1.tgz",
@ -653,6 +1110,7 @@
"version": "1.5.0", "version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz", "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
@ -670,9 +1128,21 @@
"resolved": "https://registry.nlark.com/string_decoder/download/string_decoder-0.10.31.tgz", "resolved": "https://registry.nlark.com/string_decoder/download/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
}, },
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/toidentifier": { "node_modules/toidentifier": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmmirror.com/toidentifier/download/toidentifier-1.0.1.tgz?cache=0&sync_timestamp=1636938489272&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Ftoidentifier%2Fdownload%2Ftoidentifier-1.0.1.tgz", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
"engines": { "engines": {
"node": ">=0.6" "node": ">=0.6"
@ -697,8 +1167,8 @@
}, },
"node_modules/unpipe": { "node_modules/unpipe": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.nlark.com/unpipe/download/unpipe-1.0.0.tgz", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }
@ -712,6 +1182,7 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.nlark.com/utils-merge/download/utils-merge-1.0.1.tgz", "resolved": "https://registry.nlark.com/utils-merge/download/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
"dev": true,
"engines": { "engines": {
"node": ">= 0.4.0" "node": ">= 0.4.0"
} }
@ -720,6 +1191,7 @@
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.nlark.com/vary/download/vary-1.1.2.tgz", "resolved": "https://registry.nlark.com/vary/download/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
"dev": true,
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
} }

@ -1,3 +1,10 @@
1.3.8 / 2022-02-02
==================
* deps: mime-types@~2.1.34
- deps: mime-db@~1.51.0
* deps: negotiator@0.6.3
1.3.7 / 2019-04-29 1.3.7 / 2019-04-29
================== ==================

@ -3,7 +3,7 @@
[![NPM Version][npm-version-image]][npm-url] [![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url] [![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url] [![Test Coverage][coveralls-image]][coveralls-url]
Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
@ -29,8 +29,6 @@ $ npm install accepts
## API ## API
<!-- eslint-disable no-unused-vars -->
```js ```js
var accepts = require('accepts') var accepts = require('accepts')
``` ```
@ -133,10 +131,10 @@ curl -I -H'Accept: text/html' http://localhost:3000/
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master
[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master [coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master
[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci
[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml
[node-version-image]: https://badgen.net/npm/node/accepts [node-version-image]: https://badgen.net/npm/node/accepts
[node-version-url]: https://nodejs.org/en/download [node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/accepts [npm-downloads-image]: https://badgen.net/npm/dm/accepts
[npm-url]: https://npmjs.org/package/accepts [npm-url]: https://npmjs.org/package/accepts
[npm-version-image]: https://badgen.net/npm/v/accepts [npm-version-image]: https://badgen.net/npm/v/accepts
[travis-image]: https://badgen.net/travis/jshttp/accepts/master
[travis-url]: https://travis-ci.org/jshttp/accepts

@ -1,7 +1,7 @@
{ {
"name": "accepts", "name": "accepts",
"description": "Higher-level content negotiation", "description": "Higher-level content negotiation",
"version": "1.3.7", "version": "1.3.8",
"contributors": [ "contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>", "Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)" "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
@ -9,20 +9,20 @@
"license": "MIT", "license": "MIT",
"repository": "jshttp/accepts", "repository": "jshttp/accepts",
"dependencies": { "dependencies": {
"mime-types": "~2.1.24", "mime-types": "~2.1.34",
"negotiator": "0.6.2" "negotiator": "0.6.3"
}, },
"devDependencies": { "devDependencies": {
"deep-equal": "1.0.1", "deep-equal": "1.0.1",
"eslint": "5.16.0", "eslint": "7.32.0",
"eslint-config-standard": "12.0.0", "eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.17.2", "eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "1.0.0", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "8.0.1", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.1.1", "eslint-plugin-promise": "4.3.1",
"eslint-plugin-standard": "4.0.0", "eslint-plugin-standard": "4.1.0",
"mocha": "6.1.4", "mocha": "9.2.0",
"nyc": "14.0.0" "nyc": "15.1.0"
}, },
"files": [ "files": [
"LICENSE", "LICENSE",
@ -33,10 +33,10 @@
"node": ">= 0.6" "node": ">= 0.6"
}, },
"scripts": { "scripts": {
"lint": "eslint --plugin markdown --ext js,md .", "lint": "eslint .",
"test": "mocha --reporter spec --check-leaks --bail test/", "test": "mocha --reporter spec --check-leaks --bail test/",
"test-cov": "nyc --reporter=html --reporter=text npm test", "test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-travis": "nyc --reporter=text npm test" "test-cov": "nyc --reporter=html --reporter=text npm test"
}, },
"keywords": [ "keywords": [
"content", "content",

@ -1,3 +1,30 @@
1.20.0 / 2022-04-02
===================
* Fix error message for json parse whitespace in `strict`
* Fix internal error when inflated body exceeds limit
* Prevent loss of async hooks context
* Prevent hanging when request already read
* deps: depd@2.0.0
- Replace internal `eval` usage with `Function` constructor
- Use instance methods on `process` to check for listeners
* deps: http-errors@2.0.0
- deps: depd@2.0.0
- deps: statuses@2.0.1
* deps: on-finished@2.4.1
* deps: qs@6.10.3
* deps: raw-body@2.5.1
- deps: http-errors@2.0.0
1.19.2 / 2022-02-15
===================
* deps: bytes@3.1.2
* deps: qs@6.9.7
* Fix handling of `__proto__` keys
* deps: raw-body@2.4.3
- deps: bytes@3.1.2
1.19.1 / 2021-12-10 1.19.1 / 2021-12-10
=================== ===================

@ -342,6 +342,14 @@ to this middleware. This module operates directly on bytes only and you cannot
call `req.setEncoding` when using this module. The `status` property is set to call `req.setEncoding` when using this module. The `status` property is set to
`500` and the `type` property is set to `'stream.encoding.set'`. `500` and the `type` property is set to `'stream.encoding.set'`.
### stream is not readable
This error will occur when the request is no longer readable when this middleware
attempts to read it. This typically means something other than a middleware from
this module read the reqest body already and the middleware was also configured to
read the same request. The `status` property is set to `500` and the `type`
property is set to `'stream.not.readable'`.
### too many parameters ### too many parameters
This error will occur when the content of the request exceeds the configured This error will occur when the content of the request exceeds the configured
@ -453,4 +461,4 @@ app.use(bodyParser.text({ type: 'text/html' }))
[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg [downloads-image]: https://img.shields.io/npm/dm/body-parser.svg
[downloads-url]: https://npmjs.org/package/body-parser [downloads-url]: https://npmjs.org/package/body-parser
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/expressjs/body-parser/ci/master?label=ci [github-actions-ci-image]: https://img.shields.io/github/workflow/status/expressjs/body-parser/ci/master?label=ci
[github-actions-ci-url]: https://github.com/expressjs/body-parser?query=workflow%3Aci [github-actions-ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml

@ -12,9 +12,11 @@
*/ */
var createError = require('http-errors') var createError = require('http-errors')
var destroy = require('destroy')
var getBody = require('raw-body') var getBody = require('raw-body')
var iconv = require('iconv-lite') var iconv = require('iconv-lite')
var onFinished = require('on-finished') var onFinished = require('on-finished')
var unpipe = require('unpipe')
var zlib = require('zlib') var zlib = require('zlib')
/** /**
@ -89,9 +91,14 @@ function read (req, res, next, parse, debug, options) {
_error = createError(400, error) _error = createError(400, error)
} }
// unpipe from stream and destroy
if (stream !== req) {
unpipe(req)
destroy(stream, true)
}
// read off entire request // read off entire request
stream.resume() dump(req, function onfinished () {
onFinished(req, function onfinished () {
next(createError(400, _error)) next(createError(400, _error))
}) })
return return
@ -179,3 +186,20 @@ function contentstream (req, debug, inflate) {
return stream return stream
} }
/**
* Dump the contents of a request.
*
* @param {object} req
* @param {function} callback
* @api private
*/
function dump (req, callback) {
if (onFinished.isFinished(req)) {
callback(null)
} else {
onFinished(req, callback)
req.resume()
}
}

@ -37,7 +37,7 @@ module.exports = json
* %x0D ) ; Carriage return * %x0D ) ; Carriage return
*/ */
var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*(.)/ // eslint-disable-line no-control-regex var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
/** /**
* Create a middleware to parse JSON bodies. * Create a middleware to parse JSON bodies.
@ -122,7 +122,7 @@ function json (options) {
// assert charset per RFC 7159 sec 8.1 // assert charset per RFC 7159 sec 8.1
var charset = getCharset(req) || 'utf-8' var charset = getCharset(req) || 'utf-8'
if (charset.substr(0, 4) !== 'utf-') { if (charset.slice(0, 4) !== 'utf-') {
debug('invalid charset') debug('invalid charset')
next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
charset: charset, charset: charset,
@ -152,7 +152,9 @@ function json (options) {
function createStrictSyntaxError (str, char) { function createStrictSyntaxError (str, char) {
var index = str.indexOf(char) var index = str.indexOf(char)
var partial = str.substring(0, index) + '#' var partial = index !== -1
? str.substring(0, index) + '#'
: ''
try { try {
JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
@ -173,7 +175,11 @@ function createStrictSyntaxError (str, char) {
*/ */
function firstchar (str) { function firstchar (str) {
return FIRST_CHAR_REGEXP.exec(str)[1] var match = FIRST_CHAR_REGEXP.exec(str)
return match
? match[1]
: undefined
} }
/** /**

@ -1,7 +1,7 @@
{ {
"name": "body-parser", "name": "body-parser",
"description": "Node.js body parsing middleware", "description": "Node.js body parsing middleware",
"version": "1.19.1", "version": "1.20.0",
"contributors": [ "contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>", "Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)" "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
@ -9,39 +9,43 @@
"license": "MIT", "license": "MIT",
"repository": "expressjs/body-parser", "repository": "expressjs/body-parser",
"dependencies": { "dependencies": {
"bytes": "3.1.1", "bytes": "3.1.2",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "2.0.0",
"http-errors": "1.8.1", "destroy": "1.2.0",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24", "iconv-lite": "0.4.24",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"qs": "6.9.6", "qs": "6.10.3",
"raw-body": "2.4.2", "raw-body": "2.5.1",
"type-is": "~1.6.18" "type-is": "~1.6.18",
"unpipe": "1.0.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-config-standard": "14.1.1", "eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0", "eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0", "eslint-plugin-standard": "4.1.0",
"methods": "1.1.2", "methods": "1.1.2",
"mocha": "9.1.3", "mocha": "9.2.2",
"nyc": "15.1.0", "nyc": "15.1.0",
"safe-buffer": "5.2.1", "safe-buffer": "5.2.1",
"supertest": "6.1.6" "supertest": "6.2.2"
}, },
"files": [ "files": [
"lib/", "lib/",
"LICENSE", "LICENSE",
"HISTORY.md", "HISTORY.md",
"SECURITY.md",
"index.js" "index.js"
], ],
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}, },
"scripts": { "scripts": {
"lint": "eslint .", "lint": "eslint .",

5
ui/node_modules/bytes/History.md generated vendored

@ -1,3 +1,8 @@
3.1.2 / 2022-01-27
==================
* Fix return value for un-parsable strings
3.1.1 / 2021-11-15 3.1.1 / 2021-11-15
================== ==================

4
ui/node_modules/bytes/index.js generated vendored

@ -162,5 +162,9 @@ function parse(val) {
unit = results[4].toLowerCase(); unit = results[4].toLowerCase();
} }
if (isNaN(floatValue)) {
return null;
}
return Math.floor(map[unit] * floatValue); return Math.floor(map[unit] * floatValue);
} }

@ -1,7 +1,7 @@
{ {
"name": "bytes", "name": "bytes",
"description": "Utility to parse a string bytes to bytes and vice-versa", "description": "Utility to parse a string bytes to bytes and vice-versa",
"version": "3.1.1", "version": "3.1.2",
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)", "author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
"contributors": [ "contributors": [
"Jed Watson <jed.watson@me.com>", "Jed Watson <jed.watson@me.com>",
@ -21,7 +21,7 @@
"devDependencies": { "devDependencies": {
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"mocha": "9.1.3", "mocha": "9.2.0",
"nyc": "15.1.0" "nyc": "15.1.0"
}, },
"files": [ "files": [

14
ui/node_modules/cookie/HISTORY.md generated vendored

@ -1,3 +1,17 @@
0.5.0 / 2022-04-11
==================
* Add `priority` option
* Fix `expires` option to reject invalid dates
* pref: improve default decode speed
* pref: remove slow string split in parse
0.4.2 / 2022-02-02
==================
* pref: read value only when assigning in parse
* pref: remove unnecessary regexp in parse
0.4.1 / 2020-04-21 0.4.1 / 2020-04-21
================== ==================

93
ui/node_modules/cookie/README.md generated vendored

@ -3,7 +3,7 @@
[![NPM Version][npm-version-image]][npm-url] [![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url] [![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url] [![Test Coverage][coveralls-image]][coveralls-url]
Basic HTTP cookie parser and serializer for HTTP servers. Basic HTTP cookie parser and serializer for HTTP servers.
@ -112,9 +112,23 @@ so if both are set, they should point to the same date and time.
Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path
is considered the ["default path"][rfc-6265-5.1.4]. is considered the ["default path"][rfc-6265-5.1.4].
##### priority
Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute][rfc-west-cookie-priority-00-4.1].
- `'low'` will set the `Priority` attribute to `Low`.
- `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
- `'high'` will set the `Priority` attribute to `High`.
More information about the different priority levels can be found in
[the specification][rfc-west-cookie-priority-00-4.1].
**note** This is an attribute that has not yet been fully standardized, and may change in the future.
This also means many clients may ignore this attribute until they understand it.
##### sameSite ##### sameSite
Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][rfc-6265bis-03-4.1.2.7]. Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][rfc-6265bis-09-5.4.7].
- `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement. - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
- `false` will not set the `SameSite` attribute. - `false` will not set the `SameSite` attribute.
@ -123,7 +137,7 @@ Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Coo
- `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement. - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
More information about the different enforcement levels can be found in More information about the different enforcement levels can be found in
[the specification][rfc-6265bis-03-4.1.2.7]. [the specification][rfc-6265bis-09-5.4.7].
**note** This is an attribute that has not yet been fully standardized, and may change in the future. **note** This is an attribute that has not yet been fully standardized, and may change in the future.
This also means many clients may ignore this attribute until they understand it. This also means many clients may ignore this attribute until they understand it.
@ -198,40 +212,71 @@ $ npm test
``` ```
$ npm run bench $ npm run bench
> cookie@0.3.1 bench cookie > cookie@0.4.2 bench
> node benchmark/index.js > node benchmark/index.js
http_parser@2.8.0 node@16.14.0
node@6.14.2 v8@9.4.146.24-node.20
v8@5.1.281.111 uv@1.43.0
uv@1.16.1
zlib@1.2.11 zlib@1.2.11
ares@1.10.1-DEV brotli@1.0.9
icu@58.2 ares@1.18.1
modules@48 modules@93
napi@3 nghttp2@1.45.1
openssl@1.0.2o napi@8
llhttp@6.0.4
openssl@1.1.1m+quic
cldr@40.0
icu@70.1
tz@2021a3
unicode@14.0
ngtcp2@0.1.0-DEV
nghttp3@0.1.0-DEV
> node benchmark/parse-top.js
cookie.parse - top sites
15 tests completed.
parse accounts.google.com x 2,421,245 ops/sec ±0.80% (188 runs sampled)
parse apple.com x 2,684,710 ops/sec ±0.59% (189 runs sampled)
parse cloudflare.com x 2,231,418 ops/sec ±0.76% (186 runs sampled)
parse docs.google.com x 2,316,357 ops/sec ±1.28% (187 runs sampled)
parse drive.google.com x 2,363,543 ops/sec ±0.49% (189 runs sampled)
parse en.wikipedia.org x 839,414 ops/sec ±0.53% (189 runs sampled)
parse linkedin.com x 553,797 ops/sec ±0.63% (190 runs sampled)
parse maps.google.com x 1,314,779 ops/sec ±0.72% (189 runs sampled)
parse microsoft.com x 153,783 ops/sec ±0.53% (190 runs sampled)
parse play.google.com x 2,249,574 ops/sec ±0.59% (187 runs sampled)
parse plus.google.com x 2,258,682 ops/sec ±0.60% (188 runs sampled)
parse sites.google.com x 2,247,069 ops/sec ±0.68% (189 runs sampled)
parse support.google.com x 1,456,840 ops/sec ±0.70% (187 runs sampled)
parse www.google.com x 1,046,028 ops/sec ±0.58% (188 runs sampled)
parse youtu.be x 937,428 ops/sec ±1.47% (190 runs sampled)
parse youtube.com x 963,878 ops/sec ±0.59% (190 runs sampled)
> node benchmark/parse.js > node benchmark/parse.js
cookie.parse cookie.parse - generic
6 tests completed. 6 tests completed.
simple x 1,200,691 ops/sec ±1.12% (189 runs sampled) simple x 2,745,604 ops/sec ±0.77% (185 runs sampled)
decode x 1,012,994 ops/sec ±0.97% (186 runs sampled) decode x 557,287 ops/sec ±0.60% (188 runs sampled)
unquote x 1,074,174 ops/sec ±2.43% (186 runs sampled) unquote x 2,498,475 ops/sec ±0.55% (189 runs sampled)
duplicates x 438,424 ops/sec ±2.17% (184 runs sampled) duplicates x 868,591 ops/sec ±0.89% (187 runs sampled)
10 cookies x 147,154 ops/sec ±1.01% (186 runs sampled) 10 cookies x 306,745 ops/sec ±0.49% (190 runs sampled)
100 cookies x 14,274 ops/sec ±1.07% (187 runs sampled) 100 cookies x 22,414 ops/sec ±2.38% (182 runs sampled)
``` ```
## References ## References
- [RFC 6265: HTTP State Management Mechanism][rfc-6265] - [RFC 6265: HTTP State Management Mechanism][rfc-6265]
- [Same-site Cookies][rfc-6265bis-03-4.1.2.7] - [Same-site Cookies][rfc-6265bis-09-5.4.7]
[rfc-6265bis-03-4.1.2.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7 [rfc-west-cookie-priority-00-4.1]: https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1
[rfc-6265bis-09-5.4.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7
[rfc-6265]: https://tools.ietf.org/html/rfc6265 [rfc-6265]: https://tools.ietf.org/html/rfc6265
[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4 [rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4
[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1 [rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1
@ -248,10 +293,10 @@ $ npm run bench
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master
[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master [coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/cookie/ci/master?label=ci
[github-actions-ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml
[node-version-image]: https://badgen.net/npm/node/cookie [node-version-image]: https://badgen.net/npm/node/cookie
[node-version-url]: https://nodejs.org/en/download [node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/cookie [npm-downloads-image]: https://badgen.net/npm/dm/cookie
[npm-url]: https://npmjs.org/package/cookie [npm-url]: https://npmjs.org/package/cookie
[npm-version-image]: https://badgen.net/npm/v/cookie [npm-version-image]: https://badgen.net/npm/v/cookie
[travis-image]: https://badgen.net/travis/jshttp/cookie/master
[travis-url]: https://travis-ci.org/jshttp/cookie

104
ui/node_modules/cookie/index.js generated vendored

@ -20,9 +20,7 @@ exports.serialize = serialize;
* @private * @private
*/ */
var decode = decodeURIComponent; var __toString = Object.prototype.toString
var encode = encodeURIComponent;
var pairSplitRegExp = /; */;
/** /**
* RegExp to match field-content in RFC 7230 sec 3.2 * RegExp to match field-content in RFC 7230 sec 3.2
@ -53,30 +51,42 @@ function parse(str, options) {
var obj = {} var obj = {}
var opt = options || {}; var opt = options || {};
var pairs = str.split(pairSplitRegExp);
var dec = opt.decode || decode; var dec = opt.decode || decode;
for (var i = 0; i < pairs.length; i++) { var index = 0
var pair = pairs[i]; while (index < str.length) {
var eq_idx = pair.indexOf('='); var eqIdx = str.indexOf('=', index)
// skip things that don't look like key=value // no more cookie pairs
if (eq_idx < 0) { if (eqIdx === -1) {
continue; break
} }
var key = pair.substr(0, eq_idx).trim() var endIdx = str.indexOf(';', index)
var val = pair.substr(++eq_idx, pair.length).trim();
// quoted values if (endIdx === -1) {
if ('"' == val[0]) { endIdx = str.length
val = val.slice(1, -1); } else if (endIdx < eqIdx) {
// backtrack on prior semicolon
index = str.lastIndexOf(';', eqIdx - 1) + 1
continue
} }
var key = str.slice(index, eqIdx).trim()
// only assign once // only assign once
if (undefined == obj[key]) { if (undefined === obj[key]) {
var val = str.slice(eqIdx + 1, endIdx).trim()
// quoted values
if (val.charCodeAt(0) === 0x22) {
val = val.slice(1, -1)
}
obj[key] = tryDecode(val, dec); obj[key] = tryDecode(val, dec);
} }
index = endIdx + 1
} }
return obj; return obj;
@ -145,11 +155,13 @@ function serialize(name, val, options) {
} }
if (opt.expires) { if (opt.expires) {
if (typeof opt.expires.toUTCString !== 'function') { var expires = opt.expires
if (!isDate(expires) || isNaN(expires.valueOf())) {
throw new TypeError('option expires is invalid'); throw new TypeError('option expires is invalid');
} }
str += '; Expires=' + opt.expires.toUTCString(); str += '; Expires=' + expires.toUTCString()
} }
if (opt.httpOnly) { if (opt.httpOnly) {
@ -160,6 +172,26 @@ function serialize(name, val, options) {
str += '; Secure'; str += '; Secure';
} }
if (opt.priority) {
var priority = typeof opt.priority === 'string'
? opt.priority.toLowerCase()
: opt.priority
switch (priority) {
case 'low':
str += '; Priority=Low'
break
case 'medium':
str += '; Priority=Medium'
break
case 'high':
str += '; Priority=High'
break
default:
throw new TypeError('option priority is invalid')
}
}
if (opt.sameSite) { if (opt.sameSite) {
var sameSite = typeof opt.sameSite === 'string' var sameSite = typeof opt.sameSite === 'string'
? opt.sameSite.toLowerCase() : opt.sameSite; ? opt.sameSite.toLowerCase() : opt.sameSite;
@ -185,6 +217,42 @@ function serialize(name, val, options) {
return str; return str;
} }
/**
* URL-decode string value. Optimized to skip native call when no %.
*
* @param {string} str
* @returns {string}
*/
function decode (str) {
return str.indexOf('%') !== -1
? decodeURIComponent(str)
: str
}
/**
* URL-encode value.
*
* @param {string} str
* @returns {string}
*/
function encode (val) {
return encodeURIComponent(val)
}
/**
* Determine if value is a Date.
*
* @param {*} val
* @private
*/
function isDate (val) {
return __toString.call(val) === '[object Date]' ||
val instanceof Date
}
/** /**
* Try decoding a string using a decoding function. * Try decoding a string using a decoding function.
* *

@ -1,7 +1,7 @@
{ {
"name": "cookie", "name": "cookie",
"description": "HTTP server cookie parsing and serialization", "description": "HTTP server cookie parsing and serialization",
"version": "0.4.1", "version": "0.5.0",
"author": "Roman Shtylman <shtylman@gmail.com>", "author": "Roman Shtylman <shtylman@gmail.com>",
"contributors": [ "contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>" "Douglas Christopher Wilson <doug@somethingdoug.com>"
@ -15,15 +15,18 @@
"devDependencies": { "devDependencies": {
"beautify-benchmark": "0.2.4", "beautify-benchmark": "0.2.4",
"benchmark": "2.1.4", "benchmark": "2.1.4",
"eslint": "6.8.0", "eslint": "7.32.0",
"eslint-plugin-markdown": "1.0.2", "eslint-plugin-markdown": "2.2.1",
"mocha": "7.1.1", "mocha": "9.2.2",
"nyc": "15.0.1" "nyc": "15.1.0",
"safe-buffer": "5.2.1",
"top-sites": "1.1.97"
}, },
"files": [ "files": [
"HISTORY.md", "HISTORY.md",
"LICENSE", "LICENSE",
"README.md", "README.md",
"SECURITY.md",
"index.js" "index.js"
], ],
"engines": { "engines": {
@ -31,10 +34,11 @@
}, },
"scripts": { "scripts": {
"bench": "node benchmark/index.js", "bench": "node benchmark/index.js",
"lint": "eslint --plugin markdown --ext js,md .", "lint": "eslint .",
"test": "mocha --reporter spec --bail --check-leaks --ui qunit test/", "test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "nyc --reporter=text npm test", "test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test",
"update-bench": "node scripts/update-benchmark.js",
"version": "node scripts/version-history.js && git add HISTORY.md" "version": "node scripts/version-history.js && git add HISTORY.md"
} }
} }

1
ui/node_modules/destroy/LICENSE generated vendored

@ -2,6 +2,7 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2014 Jonathan Ong me@jongleberry.com Copyright (c) 2014 Jonathan Ong me@jongleberry.com
Copyright (c) 2015-2022 Douglas Christopher Wilson doug@somethingdoug.com
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

27
ui/node_modules/destroy/README.md generated vendored

@ -1,11 +1,10 @@
# Destroy # destroy
[![NPM version][npm-image]][npm-url] [![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test coverage][coveralls-image]][coveralls-url] [![Test coverage][coveralls-image]][coveralls-url]
[![License][license-image]][license-url] [![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url] [![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]
Destroy a stream. Destroy a stream.
@ -18,17 +17,23 @@ and Node.js bugs.
var destroy = require('destroy') var destroy = require('destroy')
``` ```
### destroy(stream) ### destroy(stream [, suppress])
Destroy the given stream. In most cases, this is identical to a simple Destroy the given stream, and optionally suppress any future `error` events.
`stream.destroy()` call. The rules are as follows for a given stream:
In most cases, this is identical to a simple `stream.destroy()` call. The rules
are as follows for a given stream:
1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()`
and add a listener to the `open` event to call `stream.close()` if it is and add a listener to the `open` event to call `stream.close()` if it is
fired. This is for a Node.js bug that will leak a file descriptor if fired. This is for a Node.js bug that will leak a file descriptor if
`.destroy()` is called before `open`. `.destroy()` is called before `open`.
2. If the `stream` is not an instance of `Stream`, then nothing happens. 2. If the `stream` is an instance of a zlib stream, then call `stream.destroy()`
3. If the `stream` has a `.destroy()` method, then call it. and close the underlying zlib handle if open, otherwise call `stream.close()`.
This is for consistency across Node.js versions and a Node.js bug that will
leak a native zlib handle.
3. If the `stream` is not an instance of `Stream`, then nothing happens.
4. If the `stream` has a `.destroy()` method, then call it.
The function returns the `stream` passed in as the argument. The function returns the `stream` passed in as the argument.
@ -48,13 +53,11 @@ destroy(stream)
[npm-url]: https://npmjs.org/package/destroy [npm-url]: https://npmjs.org/package/destroy
[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square [github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square
[github-url]: https://github.com/stream-utils/destroy/tags [github-url]: https://github.com/stream-utils/destroy/tags
[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square
[travis-url]: https://travis-ci.org/stream-utils/destroy
[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square [coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master [coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master
[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square [license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square
[license-url]: LICENSE.md [license-url]: LICENSE.md
[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square [downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/destroy [downloads-url]: https://npmjs.org/package/destroy
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square [github-actions-ci-image]: https://img.shields.io/github/workflow/status/stream-utils/destroy/ci/master?label=ci&style=flat-square
[gittip-url]: https://www.gittip.com/jonathanong/ [github-actions-ci-url]: https://github.com/stream-utils/destroy/actions/workflows/ci.yml

160
ui/node_modules/destroy/index.js generated vendored

@ -1,6 +1,7 @@
/*! /*!
* destroy * destroy
* Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed * MIT Licensed
*/ */
@ -11,8 +12,10 @@
* @private * @private
*/ */
var EventEmitter = require('events').EventEmitter
var ReadStream = require('fs').ReadStream var ReadStream = require('fs').ReadStream
var Stream = require('stream') var Stream = require('stream')
var Zlib = require('zlib')
/** /**
* Module exports. * Module exports.
@ -22,23 +25,25 @@ var Stream = require('stream')
module.exports = destroy module.exports = destroy
/** /**
* Destroy a stream. * Destroy the given stream, and optionally suppress any future `error` events.
* *
* @param {object} stream * @param {object} stream
* @param {boolean} suppress
* @public * @public
*/ */
function destroy(stream) { function destroy (stream, suppress) {
if (stream instanceof ReadStream) { if (isFsReadStream(stream)) {
return destroyReadStream(stream) destroyReadStream(stream)
} } else if (isZlibStream(stream)) {
destroyZlibStream(stream)
if (!(stream instanceof Stream)) { } else if (hasDestroy(stream)) {
return stream stream.destroy()
} }
if (typeof stream.destroy === 'function') { if (isEventEmitter(stream) && suppress) {
stream.destroy() stream.removeAllListeners('error')
stream.addListener('error', noop)
} }
return stream return stream
@ -51,15 +56,144 @@ function destroy(stream) {
* @private * @private
*/ */
function destroyReadStream(stream) { function destroyReadStream (stream) {
stream.destroy() stream.destroy()
if (typeof stream.close === 'function') { if (typeof stream.close === 'function') {
// node.js core bug work-around // node.js core bug work-around
stream.on('open', onOpenClose) stream.on('open', onOpenClose)
} }
}
return stream /**
* Close a Zlib stream.
*
* Zlib streams below Node.js 4.5.5 have a buggy implementation
* of .close() when zlib encountered an error.
*
* @param {object} stream
* @private
*/
function closeZlibStream (stream) {
if (stream._hadError === true) {
var prop = stream._binding === null
? '_binding'
: '_handle'
stream[prop] = {
close: function () { this[prop] = null }
}
}
stream.close()
}
/**
* Destroy a Zlib stream.
*
* Zlib streams don't have a destroy function in Node.js 6. On top of that
* simply calling destroy on a zlib stream in Node.js 8+ will result in a
* memory leak. So until that is fixed, we need to call both close AND destroy.
*
* PR to fix memory leak: https://github.com/nodejs/node/pull/23734
*
* In Node.js 6+8, it's important that destroy is called before close as the
* stream would otherwise emit the error 'zlib binding closed'.
*
* @param {object} stream
* @private
*/
function destroyZlibStream (stream) {
if (typeof stream.destroy === 'function') {
// node.js core bug work-around
// istanbul ignore if: node.js 0.8
if (stream._binding) {
// node.js < 0.10.0
stream.destroy()
if (stream._processing) {
stream._needDrain = true
stream.once('drain', onDrainClearBinding)
} else {
stream._binding.clear()
}
} else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) {
// node.js >= 12, ^11.1.0, ^10.15.1
stream.destroy()
} else if (stream._destroy && typeof stream.close === 'function') {
// node.js 7, 8
stream.destroyed = true
stream.close()
} else {
// fallback
// istanbul ignore next
stream.destroy()
}
} else if (typeof stream.close === 'function') {
// node.js < 8 fallback
closeZlibStream(stream)
}
}
/**
* Determine if stream has destroy.
* @private
*/
function hasDestroy (stream) {
return stream instanceof Stream &&
typeof stream.destroy === 'function'
}
/**
* Determine if val is EventEmitter.
* @private
*/
function isEventEmitter (val) {
return val instanceof EventEmitter
}
/**
* Determine if stream is fs.ReadStream stream.
* @private
*/
function isFsReadStream (stream) {
return stream instanceof ReadStream
}
/**
* Determine if stream is Zlib stream.
* @private
*/
function isZlibStream (stream) {
return stream instanceof Zlib.Gzip ||
stream instanceof Zlib.Gunzip ||
stream instanceof Zlib.Deflate ||
stream instanceof Zlib.DeflateRaw ||
stream instanceof Zlib.Inflate ||
stream instanceof Zlib.InflateRaw ||
stream instanceof Zlib.Unzip
}
/**
* No-op function.
* @private
*/
function noop () {}
/**
* On drain handler to clear binding.
* @private
*/
// istanbul ignore next: node.js 0.8
function onDrainClearBinding () {
this._binding.clear()
} }
/** /**
@ -67,7 +201,7 @@ function destroyReadStream(stream) {
* @private * @private
*/ */
function onOpenClose() { function onOpenClose () {
if (typeof this.fd === 'number') { if (typeof this.fd === 'number') {
// actually close down the fd // actually close down the fd
this.close() this.close()

@ -1,7 +1,7 @@
{ {
"name": "destroy", "name": "destroy",
"description": "destroy a stream if possible", "description": "destroy a stream if possible",
"version": "1.0.4", "version": "1.2.0",
"author": { "author": {
"name": "Jonathan Ong", "name": "Jonathan Ong",
"email": "me@jongleberry.com", "email": "me@jongleberry.com",
@ -14,13 +14,24 @@
"license": "MIT", "license": "MIT",
"repository": "stream-utils/destroy", "repository": "stream-utils/destroy",
"devDependencies": { "devDependencies": {
"istanbul": "0.4.2", "eslint": "7.32.0",
"mocha": "2.3.4" "eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0",
"mocha": "9.2.2",
"nyc": "15.1.0"
},
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}, },
"scripts": { "scripts": {
"lint": "eslint .",
"test": "mocha --reporter spec", "test": "mocha --reporter spec",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" "test-cov": "nyc --reporter=html --reporter=text npm test"
}, },
"files": [ "files": [
"index.js", "index.js",

@ -1,3 +1,72 @@
4.18.1 / 2022-04-29
===================
* Fix hanging on large stack of sync routes
4.18.0 / 2022-04-25
===================
* Add "root" option to `res.download`
* Allow `options` without `filename` in `res.download`
* Deprecate string and non-integer arguments to `res.status`
* Fix behavior of `null`/`undefined` as `maxAge` in `res.cookie`
* Fix handling very large stacks of sync middleware
* Ignore `Object.prototype` values in settings through `app.set`/`app.get`
* Invoke `default` with same arguments as types in `res.format`
* Support proper 205 responses using `res.send`
* Use `http-errors` for `res.format` error
* deps: body-parser@1.20.0
- Fix error message for json parse whitespace in `strict`
- Fix internal error when inflated body exceeds limit
- Prevent loss of async hooks context
- Prevent hanging when request already read
- deps: depd@2.0.0
- deps: http-errors@2.0.0
- deps: on-finished@2.4.1
- deps: qs@6.10.3
- deps: raw-body@2.5.1
* deps: cookie@0.5.0
- Add `priority` option
- Fix `expires` option to reject invalid dates
* deps: depd@2.0.0
- Replace internal `eval` usage with `Function` constructor
- Use instance methods on `process` to check for listeners
* deps: finalhandler@1.2.0
- Remove set content headers that break response
- deps: on-finished@2.4.1
- deps: statuses@2.0.1
* deps: on-finished@2.4.1
- Prevent loss of async hooks context
* deps: qs@6.10.3
* deps: send@0.18.0
- Fix emitted 416 error missing headers property
- Limit the headers removed for 304 response
- deps: depd@2.0.0
- deps: destroy@1.2.0
- deps: http-errors@2.0.0
- deps: on-finished@2.4.1
- deps: statuses@2.0.1
* deps: serve-static@1.15.0
- deps: send@0.18.0
* deps: statuses@2.0.1
- Remove code 306
- Rename `425 Unordered Collection` to standard `425 Too Early`
4.17.3 / 2022-02-16
===================
* deps: accepts@~1.3.8
- deps: mime-types@~2.1.34
- deps: negotiator@0.6.3
* deps: body-parser@1.19.2
- deps: bytes@3.1.2
- deps: qs@6.9.7
- deps: raw-body@2.4.3
* deps: cookie@0.4.2
* deps: qs@6.9.7
* Fix handling of `__proto__` keys
* pref: remove unnecessary regexp for trust proxy
4.17.2 / 2021-12-16 4.17.2 / 2021-12-16
=================== ===================

70
ui/node_modules/express/Readme.md generated vendored

@ -2,11 +2,9 @@
Fast, unopinionated, minimalist web framework for [node](http://nodejs.org). Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
[![NPM Version][npm-image]][npm-url] [![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url] [![NPM Install Size][npm-install-size-image]][npm-install-size-url]
[![Linux Build][ci-image]][ci-url] [![NPM Downloads][npm-downloads-image]][npm-downloads-url]
[![Windows Build][appveyor-image]][appveyor-url]
[![Test Coverage][coveralls-image]][coveralls-url]
```js ```js
const express = require('express') const express = require('express')
@ -33,7 +31,7 @@ the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file).
Installation is done using the Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash ```console
$ npm install express $ npm install express
``` ```
@ -61,35 +59,31 @@ for more information.
**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x). **PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x).
### Security Issues
If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
## Quick Start ## Quick Start
The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below: The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below:
Install the executable. The executable's major version will match Express's: Install the executable. The executable's major version will match Express's:
```bash ```console
$ npm install -g express-generator@4 $ npm install -g express-generator@4
``` ```
Create the app: Create the app:
```bash ```console
$ express /tmp/foo && cd /tmp/foo $ express /tmp/foo && cd /tmp/foo
``` ```
Install dependencies: Install dependencies:
```bash ```console
$ npm install $ npm install
``` ```
Start the server: Start the server:
```bash ```console
$ npm start $ npm start
``` ```
@ -109,7 +103,7 @@ $ npm start
To view the examples, clone the Express repo and install the dependencies: To view the examples, clone the Express repo and install the dependencies:
```bash ```console
$ git clone git://github.com/expressjs/express.git --depth 1 $ git clone git://github.com/expressjs/express.git --depth 1
$ cd express $ cd express
$ npm install $ npm install
@ -117,23 +111,35 @@ $ npm install
Then run whichever example you want: Then run whichever example you want:
```bash ```console
$ node examples/content-negotiation $ node examples/content-negotiation
``` ```
## Tests ## Contributing
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
[![Windows Build][appveyor-image]][appveyor-url]
[![Test Coverage][coveralls-image]][coveralls-url]
The Express.js project welcomes all constructive contributions. Contributions take many forms,
from code for bug fixes and enhancements, to additions and fixes to documentation, additional
tests, triaging incoming pull requests and issues, and more!
To run the test suite, first install the dependencies, then run `npm test`: See the [Contributing Guide](Contributing.md) for more technical details on contributing.
```bash ### Security Issues
If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
### Running Tests
To run the test suite, first install the dependencies, then run `npm test`:
```console
$ npm install $ npm install
$ npm test $ npm test
``` ```
## Contributing
[Contributing Guide](Contributing.md)
## People ## People
The original author of Express is [TJ Holowaychuk](https://github.com/tj) The original author of Express is [TJ Holowaychuk](https://github.com/tj)
@ -146,13 +152,15 @@ The current lead maintainer is [Douglas Christopher Wilson](https://github.com/d
[MIT](LICENSE) [MIT](LICENSE)
[ci-image]: https://img.shields.io/github/workflow/status/expressjs/express/ci/master.svg?label=linux [appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/express/master?label=windows
[ci-url]: https://github.com/expressjs/express/actions?query=workflow%3Aci
[npm-image]: https://img.shields.io/npm/v/express.svg
[npm-url]: https://npmjs.org/package/express
[downloads-image]: https://img.shields.io/npm/dm/express.svg
[downloads-url]: https://npmcharts.com/compare/express?minimal=true
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express [appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
[coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg [coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/express/master
[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master [coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/express/master?label=linux
[github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml
[npm-downloads-image]: https://badgen.net/npm/dm/express
[npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true
[npm-install-size-image]: https://badgen.net/packagephobia/install/express
[npm-install-size-url]: https://packagephobia.com/result?p=express
[npm-url]: https://npmjs.org/package/express
[npm-version-image]: https://badgen.net/npm/v/express

@ -29,6 +29,13 @@ var flatten = require('array-flatten');
var merge = require('utils-merge'); var merge = require('utils-merge');
var resolve = require('path').resolve; var resolve = require('path').resolve;
var setPrototypeOf = require('setprototypeof') var setPrototypeOf = require('setprototypeof')
/**
* Module variables.
* @private
*/
var hasOwnProperty = Object.prototype.hasOwnProperty
var slice = Array.prototype.slice; var slice = Array.prototype.slice;
/** /**
@ -352,7 +359,17 @@ app.param = function param(name, fn) {
app.set = function set(setting, val) { app.set = function set(setting, val) {
if (arguments.length === 1) { if (arguments.length === 1) {
// app.get(setting) // app.get(setting)
return this.settings[setting]; var settings = this.settings
while (settings && settings !== Object.prototype) {
if (hasOwnProperty.call(settings, setting)) {
return settings[setting]
}
settings = Object.getPrototypeOf(settings)
}
return undefined
} }
debug('set "%s" to %o', setting, val); debug('set "%s" to %o', setting, val);

@ -14,6 +14,7 @@
var Buffer = require('safe-buffer').Buffer var Buffer = require('safe-buffer').Buffer
var contentDisposition = require('content-disposition'); var contentDisposition = require('content-disposition');
var createError = require('http-errors')
var deprecate = require('depd')('express'); var deprecate = require('depd')('express');
var encodeUrl = require('encodeurl'); var encodeUrl = require('encodeurl');
var escapeHtml = require('escape-html'); var escapeHtml = require('escape-html');
@ -64,6 +65,9 @@ var charsetRegExp = /;\s*charset\s*=/;
*/ */
res.status = function status(code) { res.status = function status(code) {
if ((typeof code === 'string' || Math.floor(code) !== code) && code > 99 && code < 1000) {
deprecate('res.status(' + JSON.stringify(code) + '): use res.status(' + Math.floor(code) + ') instead')
}
this.statusCode = code; this.statusCode = code;
return this; return this;
}; };
@ -135,7 +139,7 @@ res.send = function send(body) {
deprecate('res.send(status): Use res.sendStatus(status) instead'); deprecate('res.send(status): Use res.sendStatus(status) instead');
this.statusCode = chunk; this.statusCode = chunk;
chunk = statuses[chunk] chunk = statuses.message[chunk]
} }
switch (typeof chunk) { switch (typeof chunk) {
@ -213,6 +217,13 @@ res.send = function send(body) {
chunk = ''; chunk = '';
} }
// alter headers for 205
if (this.statusCode === 205) {
this.set('Content-Length', '0')
this.removeHeader('Transfer-Encoding')
chunk = ''
}
if (req.method === 'HEAD') { if (req.method === 'HEAD') {
// skip body for HEAD // skip body for HEAD
this.end(); this.end();
@ -356,7 +367,7 @@ res.jsonp = function jsonp(obj) {
*/ */
res.sendStatus = function sendStatus(statusCode) { res.sendStatus = function sendStatus(statusCode) {
var body = statuses[statusCode] || String(statusCode) var body = statuses.message[statusCode] || String(statusCode)
this.statusCode = statusCode; this.statusCode = statusCode;
this.type('txt'); this.type('txt');
@ -524,7 +535,7 @@ res.sendfile = deprecate.function(res.sendfile,
* Optionally providing an alternate attachment `filename`, * Optionally providing an alternate attachment `filename`,
* and optional callback `callback(err)`. The callback is invoked * and optional callback `callback(err)`. The callback is invoked
* when the data transfer is complete, or when an error has * when the data transfer is complete, or when an error has
* ocurred. Be sure to check `res.headersSent` if you plan to respond. * occurred. Be sure to check `res.headersSent` if you plan to respond.
* *
* Optionally providing an `options` object to use with `res.sendFile()`. * Optionally providing an `options` object to use with `res.sendFile()`.
* This function will set the `Content-Disposition` header, overriding * This function will set the `Content-Disposition` header, overriding
@ -551,6 +562,13 @@ res.download = function download (path, filename, options, callback) {
opts = null opts = null
} }
// support optional filename, where options may be in it's place
if (typeof filename === 'object' &&
(typeof options === 'function' || options === undefined)) {
name = null
opts = filename
}
// set Content-Disposition when file is sent // set Content-Disposition when file is sent
var headers = { var headers = {
'Content-Disposition': contentDisposition(name || path) 'Content-Disposition': contentDisposition(name || path)
@ -572,7 +590,9 @@ res.download = function download (path, filename, options, callback) {
opts.headers = headers opts.headers = headers
// Resolve the full path for sendFile // Resolve the full path for sendFile
var fullPath = resolve(path); var fullPath = !opts.root
? resolve(path)
: path
// send file // send file
return this.sendFile(fullPath, opts, done) return this.sendFile(fullPath, opts, done)
@ -665,9 +685,8 @@ res.format = function(obj){
var req = this.req; var req = this.req;
var next = req.next; var next = req.next;
var fn = obj.default; var keys = Object.keys(obj)
if (fn) delete obj.default; .filter(function (v) { return v !== 'default' })
var keys = Object.keys(obj);
var key = keys.length > 0 var key = keys.length > 0
? req.accepts(keys) ? req.accepts(keys)
@ -678,13 +697,12 @@ res.format = function(obj){
if (key) { if (key) {
this.set('Content-Type', normalizeType(key).value); this.set('Content-Type', normalizeType(key).value);
obj[key](req, this, next); obj[key](req, this, next);
} else if (fn) { } else if (obj.default) {
fn(); obj.default(req, this, next)
} else { } else {
var err = new Error('Not Acceptable'); next(createError(406, {
err.status = err.statusCode = 406; types: normalizeTypes(keys).map(function (o) { return o.value })
err.types = normalizeTypes(keys).map(function(o){ return o.value }); }))
next(err);
} }
return this; return this;
@ -850,9 +868,13 @@ res.cookie = function (name, value, options) {
val = 's:' + sign(val, secret); val = 's:' + sign(val, secret);
} }
if ('maxAge' in opts) { if (opts.maxAge != null) {
opts.expires = new Date(Date.now() + opts.maxAge); var maxAge = opts.maxAge - 0
opts.maxAge /= 1000;
if (!isNaN(maxAge)) {
opts.expires = new Date(Date.now() + maxAge)
opts.maxAge = Math.floor(maxAge / 1000)
}
} }
if (opts.path == null) { if (opts.path == null) {
@ -933,12 +955,12 @@ res.redirect = function redirect(url) {
// Support text/{plain,html} by default // Support text/{plain,html} by default
this.format({ this.format({
text: function(){ text: function(){
body = statuses[status] + '. Redirecting to ' + address body = statuses.message[status] + '. Redirecting to ' + address
}, },
html: function(){ html: function(){
var u = escapeHtml(address); var u = escapeHtml(address);
body = '<p>' + statuses[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>' body = '<p>' + statuses.message[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
}, },
default: function(){ default: function(){
@ -1113,7 +1135,7 @@ function sendfile(res, file, options, callback) {
* ability to escape characters that can trigger HTML sniffing. * ability to escape characters that can trigger HTML sniffing.
* *
* @param {*} value * @param {*} value
* @param {function} replaces * @param {function} replacer
* @param {number} spaces * @param {number} spaces
* @param {boolean} escape * @param {boolean} escape
* @returns {string} * @returns {string}

@ -108,8 +108,8 @@ proto.param = function param(name, fn) {
var ret; var ret;
if (name[0] === ':') { if (name[0] === ':') {
deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.substr(1)) + ', fn) instead'); deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.slice(1)) + ', fn) instead')
name = name.substr(1); name = name.slice(1)
} }
for (var i = 0; i < len; ++i) { for (var i = 0; i < len; ++i) {
@ -142,6 +142,7 @@ proto.handle = function handle(req, res, out) {
var protohost = getProtohost(req.url) || '' var protohost = getProtohost(req.url) || ''
var removed = ''; var removed = '';
var slashAdded = false; var slashAdded = false;
var sync = 0
var paramcalled = {}; var paramcalled = {};
// store options for OPTIONS request // store options for OPTIONS request
@ -180,14 +181,14 @@ proto.handle = function handle(req, res, out) {
// remove added slash // remove added slash
if (slashAdded) { if (slashAdded) {
req.url = req.url.substr(1); req.url = req.url.slice(1)
slashAdded = false; slashAdded = false;
} }
// restore altered req.url // restore altered req.url
if (removed.length !== 0) { if (removed.length !== 0) {
req.baseUrl = parentUrl; req.baseUrl = parentUrl;
req.url = protohost + removed + req.url.substr(protohost.length); req.url = protohost + removed + req.url.slice(protohost.length)
removed = ''; removed = '';
} }
@ -203,6 +204,11 @@ proto.handle = function handle(req, res, out) {
return; return;
} }
// max sync stack
if (++sync > 100) {
return setImmediate(next, err)
}
// get pathname of request // get pathname of request
var path = getPathname(req); var path = getPathname(req);
@ -251,7 +257,6 @@ proto.handle = function handle(req, res, out) {
// don't even bother matching route // don't even bother matching route
if (!has_method && method !== 'HEAD') { if (!has_method && method !== 'HEAD') {
match = false; match = false;
continue;
} }
} }
@ -274,21 +279,21 @@ proto.handle = function handle(req, res, out) {
// this should be done for the layer // this should be done for the layer
self.process_params(layer, paramcalled, req, res, function (err) { self.process_params(layer, paramcalled, req, res, function (err) {
if (err) { if (err) {
return next(layerError || err); next(layerError || err)
} } else if (route) {
layer.handle_request(req, res, next)
if (route) { } else {
return layer.handle_request(req, res, next); trim_prefix(layer, layerError, layerPath, path)
} }
trim_prefix(layer, layerError, layerPath, path); sync = 0
}); });
} }
function trim_prefix(layer, layerError, layerPath, path) { function trim_prefix(layer, layerError, layerPath, path) {
if (layerPath.length !== 0) { if (layerPath.length !== 0) {
// Validate path is a prefix match // Validate path is a prefix match
if (layerPath !== path.substr(0, layerPath.length)) { if (layerPath !== path.slice(0, layerPath.length)) {
next(layerError) next(layerError)
return return
} }
@ -301,7 +306,7 @@ proto.handle = function handle(req, res, out) {
// middleware (.use stuff) needs to have the path stripped // middleware (.use stuff) needs to have the path stripped
debug('trim prefix (%s) from url %s', layerPath, req.url); debug('trim prefix (%s) from url %s', layerPath, req.url);
removed = layerPath; removed = layerPath;
req.url = protohost + req.url.substr(protohost.length + removed.length); req.url = protohost + req.url.slice(protohost.length + removed.length)
// Ensure leading slash // Ensure leading slash
if (!protohost && req.url[0] !== '/') { if (!protohost && req.url[0] !== '/') {
@ -547,10 +552,10 @@ function getProtohost(url) {
var pathLength = searchIndex !== -1 var pathLength = searchIndex !== -1
? searchIndex ? searchIndex
: url.length : url.length
var fqdnIndex = url.substr(0, pathLength).indexOf('://') var fqdnIndex = url.slice(0, pathLength).indexOf('://')
return fqdnIndex !== -1 return fqdnIndex !== -1
? url.substr(0, url.indexOf('/', 3 + fqdnIndex)) ? url.substring(0, url.indexOf('/', 3 + fqdnIndex))
: undefined : undefined
} }

@ -98,6 +98,8 @@ Route.prototype._options = function _options() {
Route.prototype.dispatch = function dispatch(req, res, done) { Route.prototype.dispatch = function dispatch(req, res, done) {
var idx = 0; var idx = 0;
var stack = this.stack; var stack = this.stack;
var sync = 0
if (stack.length === 0) { if (stack.length === 0) {
return done(); return done();
} }
@ -127,6 +129,11 @@ Route.prototype.dispatch = function dispatch(req, res, done) {
return done(err); return done(err);
} }
// max sync stack
if (++sync > 100) {
return setImmediate(next, err)
}
if (layer.method && layer.method !== method) { if (layer.method && layer.method !== method) {
return next(err); return next(err);
} }
@ -136,6 +143,8 @@ Route.prototype.dispatch = function dispatch(req, res, done) {
} else { } else {
layer.handle_request(req, res, next); layer.handle_request(req, res, next);
} }
sync = 0
} }
}; };

@ -120,6 +120,7 @@ exports.contentDisposition = deprecate.function(contentDisposition,
* also includes `.originalIndex` for stable sorting * also includes `.originalIndex` for stable sorting
* *
* @param {String} str * @param {String} str
* @param {Number} index
* @return {Object} * @return {Object}
* @api private * @api private
*/ */
@ -228,7 +229,8 @@ exports.compileTrust = function(val) {
if (typeof val === 'string') { if (typeof val === 'string') {
// Support comma-separated values // Support comma-separated values
val = val.split(/ *, */); val = val.split(',')
.map(function (v) { return v.trim() })
} }
return proxyaddr.compile(val || []); return proxyaddr.compile(val || []);

@ -74,7 +74,7 @@ function View(name, options) {
if (!opts.engines[this.ext]) { if (!opts.engines[this.ext]) {
// load engine // load engine
var mod = this.ext.substr(1) var mod = this.ext.slice(1)
debug('require "%s"', mod) debug('require "%s"', mod)
// default engine export // default engine export

@ -1,7 +1,7 @@
{ {
"name": "express", "name": "express",
"description": "Fast, unopinionated, minimalist web framework", "description": "Fast, unopinionated, minimalist web framework",
"version": "4.17.2", "version": "4.18.1",
"author": "TJ Holowaychuk <tj@vision-media.ca>", "author": "TJ Holowaychuk <tj@vision-media.ca>",
"contributors": [ "contributors": [
"Aaron Heckmann <aaron.heckmann+github@gmail.com>", "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
@ -28,33 +28,34 @@
"api" "api"
], ],
"dependencies": { "dependencies": {
"accepts": "~1.3.7", "accepts": "~1.3.8",
"array-flatten": "1.1.1", "array-flatten": "1.1.1",
"body-parser": "1.19.1", "body-parser": "1.20.0",
"content-disposition": "0.5.4", "content-disposition": "0.5.4",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"cookie": "0.4.1", "cookie": "0.5.0",
"cookie-signature": "1.0.6", "cookie-signature": "1.0.6",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "2.0.0",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"etag": "~1.8.1", "etag": "~1.8.1",
"finalhandler": "~1.1.2", "finalhandler": "1.2.0",
"fresh": "0.5.2", "fresh": "0.5.2",
"http-errors": "2.0.0",
"merge-descriptors": "1.0.1", "merge-descriptors": "1.0.1",
"methods": "~1.1.2", "methods": "~1.1.2",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"path-to-regexp": "0.1.7", "path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.7", "proxy-addr": "~2.0.7",
"qs": "6.9.6", "qs": "6.10.3",
"range-parser": "~1.2.1", "range-parser": "~1.2.1",
"safe-buffer": "5.2.1", "safe-buffer": "5.2.1",
"send": "0.17.2", "send": "0.18.0",
"serve-static": "1.14.2", "serve-static": "1.15.0",
"setprototypeof": "1.2.0", "setprototypeof": "1.2.0",
"statuses": "~1.5.0", "statuses": "2.0.1",
"type-is": "~1.6.18", "type-is": "~1.6.18",
"utils-merge": "1.0.1", "utils-merge": "1.0.1",
"vary": "~1.1.2" "vary": "~1.1.2"
@ -64,19 +65,18 @@
"connect-redis": "3.4.2", "connect-redis": "3.4.2",
"cookie-parser": "1.4.6", "cookie-parser": "1.4.6",
"cookie-session": "2.0.0", "cookie-session": "2.0.0",
"ejs": "3.1.6", "ejs": "3.1.7",
"eslint": "7.32.0", "eslint": "7.32.0",
"express-session": "1.17.2", "express-session": "1.17.2",
"hbs": "4.2.0", "hbs": "4.2.0",
"istanbul": "0.4.5",
"marked": "0.7.0", "marked": "0.7.0",
"method-override": "3.0.0", "method-override": "3.0.0",
"mocha": "9.1.3", "mocha": "9.2.2",
"morgan": "1.10.0", "morgan": "1.10.0",
"multiparty": "4.2.2", "multiparty": "4.2.3",
"nyc": "15.1.0",
"pbkdf2-password": "1.2.1", "pbkdf2-password": "1.2.1",
"should": "13.2.3", "supertest": "6.2.3",
"supertest": "6.1.6",
"vhost": "~3.0.2" "vhost": "~3.0.2"
}, },
"engines": { "engines": {
@ -92,8 +92,8 @@
"scripts": { "scripts": {
"lint": "eslint .", "lint": "eslint .",
"test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/", "test-cov": "nyc --reporter=html --reporter=text npm test",
"test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"
} }
} }

@ -1,3 +1,11 @@
1.2.0 / 2022-03-22
==================
* Remove set content headers that break response
* deps: on-finished@2.4.1
* deps: statuses@2.0.1
- Rename `425 Unordered Collection` to standard `425 Too Early`
1.1.2 / 2019-05-09 1.1.2 / 2019-05-09
================== ==================

@ -1,6 +1,6 @@
(The MIT License) (The MIT License)
Copyright (c) 2014-2017 Douglas Christopher Wilson <doug@somethingdoug.com> Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

@ -3,7 +3,7 @@
[![NPM Version][npm-image]][npm-url] [![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url] [![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-image]][node-url] [![Node.js Version][node-image]][node-url]
[![Build Status][travis-image]][travis-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url] [![Test Coverage][coveralls-image]][coveralls-url]
Node.js function to invoke as the final step to respond to HTTP request. Node.js function to invoke as the final step to respond to HTTP request.
@ -20,8 +20,6 @@ $ npm install finalhandler
## API ## API
<!-- eslint-disable no-unused-vars -->
```js ```js
var finalhandler = require('finalhandler') var finalhandler = require('finalhandler')
``` ```
@ -31,7 +29,8 @@ var finalhandler = require('finalhandler')
Returns function to be invoked as the final step for the given `req` and `res`. Returns function to be invoked as the final step for the given `req` and `res`.
This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will
write out a 404 response to the `res`. If it is truthy, an error response will write out a 404 response to the `res`. If it is truthy, an error response will
be written out to the `res`. be written out to the `res` or `res` will be terminated if a response has already
started.
When an error is written, the following information is added to the response: When an error is written, the following information is added to the response:
@ -140,9 +139,9 @@ function logerror (err) {
[npm-url]: https://npmjs.org/package/finalhandler [npm-url]: https://npmjs.org/package/finalhandler
[node-image]: https://img.shields.io/node/v/finalhandler.svg [node-image]: https://img.shields.io/node/v/finalhandler.svg
[node-url]: https://nodejs.org/en/download [node-url]: https://nodejs.org/en/download
[travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg
[travis-url]: https://travis-ci.org/pillarjs/finalhandler
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg [coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg
[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master [coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master
[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg [downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg
[downloads-url]: https://npmjs.org/package/finalhandler [downloads-url]: https://npmjs.org/package/finalhandler
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/pillarjs/finalhandler/ci/master?label=ci
[github-actions-ci-url]: https://github.com/jshttp/pillarjs/finalhandler?query=workflow%3Aci

@ -1,6 +1,6 @@
/*! /*!
* finalhandler * finalhandler
* Copyright(c) 2014-2017 Douglas Christopher Wilson * Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed * MIT Licensed
*/ */
@ -181,7 +181,7 @@ function getErrorMessage (err, status, env) {
} }
} }
return msg || statuses[status] return msg || statuses.message[status]
} }
/** /**
@ -276,7 +276,12 @@ function send (req, res, status, headers, message) {
// response status // response status
res.statusCode = status res.statusCode = status
res.statusMessage = statuses[status] res.statusMessage = statuses.message[status]
// remove any content headers
res.removeHeader('Content-Encoding')
res.removeHeader('Content-Language')
res.removeHeader('Content-Range')
// response headers // response headers
setHeaders(res, headers) setHeaders(res, headers)

@ -1,7 +1,7 @@
{ {
"name": "finalhandler", "name": "finalhandler",
"description": "Node.js final http responder", "description": "Node.js final http responder",
"version": "1.1.2", "version": "1.2.0",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>", "author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
"license": "MIT", "license": "MIT",
"repository": "pillarjs/finalhandler", "repository": "pillarjs/finalhandler",
@ -9,37 +9,38 @@
"debug": "2.6.9", "debug": "2.6.9",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"statuses": "~1.5.0", "statuses": "2.0.1",
"unpipe": "~1.0.0" "unpipe": "~1.0.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "5.16.0", "eslint": "7.32.0",
"eslint-config-standard": "12.0.0", "eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.17.2", "eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "1.0.0", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "8.0.1", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.1.1", "eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.0.0", "eslint-plugin-standard": "4.1.0",
"istanbul": "0.4.5", "mocha": "9.2.2",
"mocha": "6.1.4", "nyc": "15.1.0",
"readable-stream": "2.3.6", "readable-stream": "2.3.6",
"safe-buffer": "5.1.2", "safe-buffer": "5.2.1",
"supertest": "4.0.2" "supertest": "6.2.2"
}, },
"files": [ "files": [
"LICENSE", "LICENSE",
"HISTORY.md", "HISTORY.md",
"SECURITY.md",
"index.js" "index.js"
], ],
"engines": { "engines": {
"node": ">= 0.8" "node": ">= 0.8"
}, },
"scripts": { "scripts": {
"lint": "eslint --plugin markdown --ext js,md .", "lint": "eslint .",
"test": "mocha --reporter spec --bail --check-leaks test/", "test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" "test-cov": "nyc --reporter=html --reporter=text npm test"
} }
} }

@ -1,3 +1,18 @@
2.0.0 / 2021-12-17
==================
* Drop support for Node.js 0.6
* Remove `I'mateapot` export; use `ImATeapot` instead
* Remove support for status being non-first argument
* Rename `UnorderedCollection` constructor to `TooEarly`
* deps: depd@2.0.0
- Replace internal `eval` usage with `Function` constructor
- Use instance methods on `process` to check for listeners
* deps: statuses@2.0.1
- Fix messaging casing of `418 I'm a Teapot`
- Remove code 306
- Rename `425 Unordered Collection` to standard `425 Too Early`
2021-11-14 / 1.8.1 2021-11-14 / 1.8.1
================== ==================

@ -14,7 +14,7 @@ This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the [npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash ```console
$ npm install http-errors $ npm install http-errors
``` ```
@ -133,7 +133,7 @@ var err = new createError.NotFound()
|422 |UnprocessableEntity | |422 |UnprocessableEntity |
|423 |Locked | |423 |Locked |
|424 |FailedDependency | |424 |FailedDependency |
|425 |UnorderedCollection | |425 |TooEarly |
|426 |UpgradeRequired | |426 |UpgradeRequired |
|428 |PreconditionRequired | |428 |PreconditionRequired |
|429 |TooManyRequests | |429 |TooManyRequests |

@ -54,24 +54,18 @@ function createError () {
var props = {} var props = {}
for (var i = 0; i < arguments.length; i++) { for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i] var arg = arguments[i]
if (arg instanceof Error) { var type = typeof arg
if (type === 'object' && arg instanceof Error) {
err = arg err = arg
status = err.status || err.statusCode || status status = err.status || err.statusCode || status
continue } else if (type === 'number' && i === 0) {
} status = arg
switch (typeof arg) { } else if (type === 'string') {
case 'string': msg = arg
msg = arg } else if (type === 'object') {
break props = arg
case 'number': } else {
status = arg throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type)
if (i !== 0) {
deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)')
}
break
case 'object':
props = arg
break
} }
} }
@ -80,7 +74,7 @@ function createError () {
} }
if (typeof status !== 'number' || if (typeof status !== 'number' ||
(!statuses[status] && (status < 400 || status >= 600))) { (!statuses.message[status] && (status < 400 || status >= 600))) {
status = 500 status = 500
} }
@ -91,7 +85,7 @@ function createError () {
// create error // create error
err = HttpError err = HttpError
? new HttpError(msg) ? new HttpError(msg)
: new Error(msg || statuses[status]) : new Error(msg || statuses.message[status])
Error.captureStackTrace(err, createError) Error.captureStackTrace(err, createError)
} }
@ -135,7 +129,7 @@ function createClientErrorConstructor (HttpError, name, code) {
function ClientError (message) { function ClientError (message) {
// create the error object // create the error object
var msg = message != null ? message : statuses[code] var msg = message != null ? message : statuses.message[code]
var err = new Error(msg) var err = new Error(msg)
// capture a stack trace to the construction point // capture a stack trace to the construction point
@ -204,7 +198,7 @@ function createServerErrorConstructor (HttpError, name, code) {
function ServerError (message) { function ServerError (message) {
// create the error object // create the error object
var msg = message != null ? message : statuses[code] var msg = message != null ? message : statuses.message[code]
var err = new Error(msg) var err = new Error(msg)
// capture a stack trace to the construction point // capture a stack trace to the construction point
@ -264,7 +258,7 @@ function nameFunc (func, name) {
function populateConstructorExports (exports, codes, HttpError) { function populateConstructorExports (exports, codes, HttpError) {
codes.forEach(function forEachCode (code) { codes.forEach(function forEachCode (code) {
var CodeError var CodeError
var name = toIdentifier(statuses[code]) var name = toIdentifier(statuses.message[code])
switch (codeClass(code)) { switch (codeClass(code)) {
case 400: case 400:
@ -281,10 +275,6 @@ function populateConstructorExports (exports, codes, HttpError) {
exports[name] = CodeError exports[name] = CodeError
} }
}) })
// backwards-compatibility
exports["I'mateapot"] = deprecate.function(exports.ImATeapot,
'"I\'mateapot"; use "ImATeapot" instead')
} }
/** /**

@ -1,7 +1,7 @@
{ {
"name": "http-errors", "name": "http-errors",
"description": "Create HTTP error objects", "description": "Create HTTP error objects",
"version": "1.8.1", "version": "2.0.0",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", "author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"contributors": [ "contributors": [
"Alan Plum <me@pluma.io>", "Alan Plum <me@pluma.io>",
@ -10,10 +10,10 @@
"license": "MIT", "license": "MIT",
"repository": "jshttp/http-errors", "repository": "jshttp/http-errors",
"dependencies": { "dependencies": {
"depd": "~1.1.2", "depd": "2.0.0",
"inherits": "2.0.4", "inherits": "2.0.4",
"setprototypeof": "1.2.0", "setprototypeof": "1.2.0",
"statuses": ">= 1.5.0 < 2", "statuses": "2.0.1",
"toidentifier": "1.0.1" "toidentifier": "1.0.1"
}, },
"devDependencies": { "devDependencies": {
@ -22,19 +22,20 @@
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.3",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.1", "eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0", "eslint-plugin-standard": "4.1.0",
"mocha": "9.1.3", "mocha": "9.1.3",
"nyc": "15.1.0" "nyc": "15.1.0"
}, },
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.8"
}, },
"scripts": { "scripts": {
"lint": "eslint . && node ./scripts/lint-readme-list.js", "lint": "eslint . && node ./scripts/lint-readme-list.js",
"test": "mocha --reporter spec --bail", "test": "mocha --reporter spec --bail",
"test-ci": "nyc --reporter=lcov --reporter=text npm test", "test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test" "test-cov": "nyc --reporter=html --reporter=text npm test",
"version": "node scripts/version-history.js && git add HISTORY.md"
}, },
"keywords": [ "keywords": [
"http", "http",

@ -1,3 +1,8 @@
0.6.3 / 2022-01-22
==================
* Revert "Lazy-load modules from main entry point"
0.6.2 / 2019-04-29 0.6.2 / 2019-04-29
================== ==================

@ -3,7 +3,7 @@
[![NPM Version][npm-image]][npm-url] [![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url] [![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url] [![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url] [![Test Coverage][coveralls-image]][coveralls-url]
An HTTP content negotiator for Node.js An HTTP content negotiator for Node.js
@ -195,9 +195,9 @@ and more.
[npm-url]: https://npmjs.org/package/negotiator [npm-url]: https://npmjs.org/package/negotiator
[node-version-image]: https://img.shields.io/node/v/negotiator.svg [node-version-image]: https://img.shields.io/node/v/negotiator.svg
[node-version-url]: https://nodejs.org/en/download/ [node-version-url]: https://nodejs.org/en/download/
[travis-image]: https://img.shields.io/travis/jshttp/negotiator/master.svg
[travis-url]: https://travis-ci.org/jshttp/negotiator
[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg [coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master [coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master
[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg [downloads-image]: https://img.shields.io/npm/dm/negotiator.svg
[downloads-url]: https://npmjs.org/package/negotiator [downloads-url]: https://npmjs.org/package/negotiator
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci
[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml

@ -8,12 +8,10 @@
'use strict'; 'use strict';
/** var preferredCharsets = require('./lib/charset')
* Cached loaded submodules. var preferredEncodings = require('./lib/encoding')
* @private var preferredLanguages = require('./lib/language')
*/ var preferredMediaTypes = require('./lib/mediaType')
var modules = Object.create(null);
/** /**
* Module exports. * Module exports.
@ -43,7 +41,6 @@ Negotiator.prototype.charset = function charset(available) {
}; };
Negotiator.prototype.charsets = function charsets(available) { Negotiator.prototype.charsets = function charsets(available) {
var preferredCharsets = loadModule('charset').preferredCharsets;
return preferredCharsets(this.request.headers['accept-charset'], available); return preferredCharsets(this.request.headers['accept-charset'], available);
}; };
@ -53,7 +50,6 @@ Negotiator.prototype.encoding = function encoding(available) {
}; };
Negotiator.prototype.encodings = function encodings(available) { Negotiator.prototype.encodings = function encodings(available) {
var preferredEncodings = loadModule('encoding').preferredEncodings;
return preferredEncodings(this.request.headers['accept-encoding'], available); return preferredEncodings(this.request.headers['accept-encoding'], available);
}; };
@ -63,7 +59,6 @@ Negotiator.prototype.language = function language(available) {
}; };
Negotiator.prototype.languages = function languages(available) { Negotiator.prototype.languages = function languages(available) {
var preferredLanguages = loadModule('language').preferredLanguages;
return preferredLanguages(this.request.headers['accept-language'], available); return preferredLanguages(this.request.headers['accept-language'], available);
}; };
@ -73,7 +68,6 @@ Negotiator.prototype.mediaType = function mediaType(available) {
}; };
Negotiator.prototype.mediaTypes = function mediaTypes(available) { Negotiator.prototype.mediaTypes = function mediaTypes(available) {
var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes;
return preferredMediaTypes(this.request.headers.accept, available); return preferredMediaTypes(this.request.headers.accept, available);
}; };
@ -86,39 +80,3 @@ Negotiator.prototype.preferredLanguage = Negotiator.prototype.language;
Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages;
Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;
Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;
/**
* Load the given module.
* @private
*/
function loadModule(moduleName) {
var module = modules[moduleName];
if (module !== undefined) {
return module;
}
// This uses a switch for static require analysis
switch (moduleName) {
case 'charset':
module = require('./lib/charset');
break;
case 'encoding':
module = require('./lib/encoding');
break;
case 'language':
module = require('./lib/language');
break;
case 'mediaType':
module = require('./lib/mediaType');
break;
default:
throw new Error('Cannot find module \'' + moduleName + '\'');
}
// Store to prevent invoking require()
modules[moduleName] = module;
return module;
}

@ -54,9 +54,9 @@ function parseLanguage(str, i) {
var match = simpleLanguageRegExp.exec(str); var match = simpleLanguageRegExp.exec(str);
if (!match) return null; if (!match) return null;
var prefix = match[1], var prefix = match[1]
suffix = match[2], var suffix = match[2]
full = prefix; var full = prefix
if (suffix) full += "-" + suffix; if (suffix) full += "-" + suffix;

@ -1,7 +1,7 @@
{ {
"name": "negotiator", "name": "negotiator",
"description": "HTTP content negotiation", "description": "HTTP content negotiation",
"version": "0.6.2", "version": "0.6.3",
"contributors": [ "contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>", "Douglas Christopher Wilson <doug@somethingdoug.com>",
"Federico Romero <federico.romero@outboxlabs.com>", "Federico Romero <federico.romero@outboxlabs.com>",
@ -18,10 +18,10 @@
], ],
"repository": "jshttp/negotiator", "repository": "jshttp/negotiator",
"devDependencies": { "devDependencies": {
"eslint": "5.16.0", "eslint": "7.32.0",
"eslint-plugin-markdown": "1.0.0", "eslint-plugin-markdown": "2.2.1",
"mocha": "6.1.4", "mocha": "9.1.3",
"nyc": "14.0.0" "nyc": "15.1.0"
}, },
"files": [ "files": [
"lib/", "lib/",
@ -34,9 +34,9 @@
"node": ">= 0.6" "node": ">= 0.6"
}, },
"scripts": { "scripts": {
"lint": "eslint --plugin markdown --ext js,md .", "lint": "eslint .",
"test": "mocha --reporter spec --check-leaks --bail test/", "test": "mocha --reporter spec --check-leaks --bail test/",
"test-cov": "nyc --reporter=html --reporter=text npm test", "test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-travis": "nyc --reporter=text npm test" "test-cov": "nyc --reporter=html --reporter=text npm test"
} }
} }

1
ui/node_modules/qs/.editorconfig generated vendored

@ -8,6 +8,7 @@ charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
max_line_length = 160 max_line_length = 160
quote_type = single
[test/*] [test/*]
max_line_length = off max_line_length = off

2
ui/node_modules/qs/.eslintignore generated vendored

@ -1,2 +0,0 @@
dist/
coverage/

9
ui/node_modules/qs/.eslintrc generated vendored

@ -3,20 +3,23 @@
"extends": "@ljharb", "extends": "@ljharb",
"ignorePatterns": [
"dist/",
],
"rules": { "rules": {
"complexity": 0, "complexity": 0,
"consistent-return": 1, "consistent-return": 1,
"func-name-matching": 0, "func-name-matching": 0,
"id-length": [2, { "min": 1, "max": 25, "properties": "never" }], "id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
"indent": [2, 4], "indent": [2, 4],
"max-lines-per-function": [2, { "max": 150 }], "max-lines-per-function": [2, { "max": 150 }],
"max-params": [2, 14], "max-params": [2, 15],
"max-statements": [2, 52], "max-statements": [2, 52],
"multiline-comment-style": 0, "multiline-comment-style": 0,
"no-continue": 1, "no-continue": 1,
"no-magic-numbers": 0, "no-magic-numbers": 0,
"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
"operator-linebreak": [2, "before"],
}, },
"overrides": [ "overrides": [

29
ui/node_modules/qs/CHANGELOG.md generated vendored

@ -1,3 +1,32 @@
## **6.10.3**
- [Fix] `parse`: ignore `__proto__` keys (#428)
- [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
- [actions] reuse common workflows
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape`
## **6.10.2**
- [Fix] `stringify`: actually fix cyclic references (#426)
- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
- [readme] remove travis badge; add github actions/codecov badges; update URLs
- [Docs] add note and links for coercing primitive values (#408)
- [actions] update codecov uploader
- [actions] update workflows
- [Tests] clean up stringify tests slightly
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape`
## **6.10.1**
- [Fix] `stringify`: avoid exception on repeated object values (#402)
## **6.10.0**
- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393)
- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312)
- [meta] fix README.md (#399)
- [meta] only run `npm run dist` in publish, not install
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape`
- [Tests] fix tests on node v0.6
- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run`
- [Tests] Revert "[meta] ignore eclint transitive audit warning"
## **6.9.6** ## **6.9.6**
- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 - [Fix] restore `dist` dir; mistakenly removed in d4f6c32

57
ui/node_modules/qs/README.md generated vendored

@ -1,12 +1,13 @@
# qs <sup>[![Version Badge][2]][1]</sup> # qs <sup>[![Version Badge][2]][1]</sup>
[![Build Status][3]][4] [![github actions][actions-image]][actions-url]
[![dependency status][5]][6] [![coverage][codecov-image]][codecov-url]
[![dev dependency status][7]][8] [![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url] [![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url] [![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1] [![npm badge][npm-badge-png]][package-url]
A querystring parsing and stringifying library with some added security. A querystring parsing and stringifying library with some added security.
@ -227,6 +228,13 @@ var noSparse = qs.parse('a[1]=b&a[15]=c');
assert.deepEqual(noSparse, { a: ['b', 'c'] }); assert.deepEqual(noSparse, { a: ['b', 'c'] });
``` ```
You may also use `allowSparse` option to parse sparse arrays:
```javascript
var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true });
assert.deepEqual(sparseArray, { a: [, '2', , '5'] });
```
Note that an empty string is also a value, and will be preserved: Note that an empty string is also a value, and will be preserved:
```javascript ```javascript
@ -280,6 +288,17 @@ assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] })
``` ```
(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) (_this cannot convert nested objects, such as `a={b:1},{c:d}`_)
### Parsing primitive/scalar values (numbers, booleans, null, etc)
By default, all values are parsed as strings. This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91).
```javascript
var primitiveValues = qs.parse('a=15&b=true&c=null');
assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' });
```
If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters.
### Stringifying ### Stringifying
[](#preventEval) [](#preventEval)
@ -345,7 +364,7 @@ var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultE
The type argument is also provided to the decoder: The type argument is also provided to the decoder:
```javascript ```javascript
var decoded = qs.parse('x=z', { decoder: function (str, defaultEncoder, charset, type) { var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) {
if (type === 'key') { if (type === 'key') {
return // Decoded key return // Decoded key
} else if (type === 'value') { } else if (type === 'value') {
@ -587,18 +606,18 @@ Available as part of the Tidelift Subscription
The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
[1]: https://npmjs.org/package/qs [package-url]: https://npmjs.org/package/qs
[2]: http://versionbadg.es/ljharb/qs.svg [npm-version-svg]: https://versionbadg.es/ljharb/qs.svg
[3]: https://api.travis-ci.org/ljharb/qs.svg [deps-svg]: https://david-dm.org/ljharb/qs.svg
[4]: https://travis-ci.org/ljharb/qs [deps-url]: https://david-dm.org/ljharb/qs
[5]: https://david-dm.org/ljharb/qs.svg [dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg
[6]: https://david-dm.org/ljharb/qs [dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies
[7]: https://david-dm.org/ljharb/qs/dev-status.svg [npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true
[8]: https://david-dm.org/ljharb/qs?type=dev [license-image]: https://img.shields.io/npm/l/qs.svg
[9]: https://ci.testling.com/ljharb/qs.png
[10]: https://ci.testling.com/ljharb/qs
[11]: https://nodei.co/npm/qs.png?downloads=true&stars=true
[license-image]: http://img.shields.io/npm/l/qs.svg
[license-url]: LICENSE [license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/qs.svg [downloads-image]: https://img.shields.io/npm/dm/qs.svg
[downloads-url]: http://npm-stat.com/charts.html?package=qs [downloads-url]: https://npm-stat.com/charts.html?package=qs
[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/qs/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs
[actions-url]: https://github.com/ljharb/qs/actions

1234
ui/node_modules/qs/dist/qs.js generated vendored

File diff suppressed because it is too large Load Diff

8
ui/node_modules/qs/lib/parse.js generated vendored

@ -8,6 +8,7 @@ var isArray = Array.isArray;
var defaults = { var defaults = {
allowDots: false, allowDots: false,
allowPrototypes: false, allowPrototypes: false,
allowSparse: false,
arrayLimit: 20, arrayLimit: 20,
charset: 'utf-8', charset: 'utf-8',
charsetSentinel: false, charsetSentinel: false,
@ -135,7 +136,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
) { ) {
obj = []; obj = [];
obj[index] = leaf; obj[index] = leaf;
} else { } else if (cleanRoot !== '__proto__') {
obj[cleanRoot] = leaf; obj[cleanRoot] = leaf;
} }
} }
@ -217,6 +218,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
return { return {
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
charset: charset, charset: charset,
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
@ -253,5 +255,9 @@ module.exports = function (str, opts) {
obj = utils.merge(obj, newObj, options); obj = utils.merge(obj, newObj, options);
} }
if (options.allowSparse === true) {
return obj;
}
return utils.compact(obj); return utils.compact(obj);
}; };

@ -1,5 +1,6 @@
'use strict'; 'use strict';
var getSideChannel = require('side-channel');
var utils = require('./utils'); var utils = require('./utils');
var formats = require('./formats'); var formats = require('./formats');
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
@ -18,6 +19,7 @@ var arrayPrefixGenerators = {
}; };
var isArray = Array.isArray; var isArray = Array.isArray;
var split = String.prototype.split;
var push = Array.prototype.push; var push = Array.prototype.push;
var pushToArray = function (arr, valueOrArray) { var pushToArray = function (arr, valueOrArray) {
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
@ -54,6 +56,8 @@ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|| typeof v === 'bigint'; || typeof v === 'bigint';
}; };
var sentinel = {};
var stringify = function stringify( var stringify = function stringify(
object, object,
prefix, prefix,
@ -68,9 +72,30 @@ var stringify = function stringify(
format, format,
formatter, formatter,
encodeValuesOnly, encodeValuesOnly,
charset charset,
sideChannel
) { ) {
var obj = object; var obj = object;
var tmpSc = sideChannel;
var step = 0;
var findFlag = false;
while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
// Where object last appeared in the ref tree
var pos = tmpSc.get(object);
step += 1;
if (typeof pos !== 'undefined') {
if (pos === step) {
throw new RangeError('Cyclic object value');
} else {
findFlag = true; // Break while
}
}
if (typeof tmpSc.get(sentinel) === 'undefined') {
step = 0;
}
}
if (typeof filter === 'function') { if (typeof filter === 'function') {
obj = filter(prefix, obj); obj = filter(prefix, obj);
} else if (obj instanceof Date) { } else if (obj instanceof Date) {
@ -95,6 +120,14 @@ var stringify = function stringify(
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
if (encoder) { if (encoder) {
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
var valuesArray = split.call(String(obj), ',');
var valuesJoined = '';
for (var i = 0; i < valuesArray.length; ++i) {
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
}
return [formatter(keyValue) + '=' + valuesJoined];
}
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
} }
return [formatter(prefix) + '=' + formatter(String(obj))]; return [formatter(prefix) + '=' + formatter(String(obj))];
@ -109,7 +142,7 @@ var stringify = function stringify(
var objKeys; var objKeys;
if (generateArrayPrefix === 'comma' && isArray(obj)) { if (generateArrayPrefix === 'comma' && isArray(obj)) {
// we need to join elements in // we need to join elements in
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }]; objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
} else if (isArray(filter)) { } else if (isArray(filter)) {
objKeys = filter; objKeys = filter;
} else { } else {
@ -117,9 +150,9 @@ var stringify = function stringify(
objKeys = sort ? keys.sort(sort) : keys; objKeys = sort ? keys.sort(sort) : keys;
} }
for (var i = 0; i < objKeys.length; ++i) { for (var j = 0; j < objKeys.length; ++j) {
var key = objKeys[i]; var key = objKeys[j];
var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key]; var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
if (skipNulls && value === null) { if (skipNulls && value === null) {
continue; continue;
@ -129,6 +162,9 @@ var stringify = function stringify(
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
: prefix + (allowDots ? '.' + key : '[' + key + ']'); : prefix + (allowDots ? '.' + key : '[' + key + ']');
sideChannel.set(object, step);
var valueSideChannel = getSideChannel();
valueSideChannel.set(sentinel, sideChannel);
pushToArray(values, stringify( pushToArray(values, stringify(
value, value,
keyPrefix, keyPrefix,
@ -143,7 +179,8 @@ var stringify = function stringify(
format, format,
formatter, formatter,
encodeValuesOnly, encodeValuesOnly,
charset charset,
valueSideChannel
)); ));
} }
@ -155,7 +192,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
return defaults; return defaults;
} }
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
throw new TypeError('Encoder has to be a function.'); throw new TypeError('Encoder has to be a function.');
} }
@ -237,6 +274,7 @@ module.exports = function (object, opts) {
objKeys.sort(options.sort); objKeys.sort(options.sort);
} }
var sideChannel = getSideChannel();
for (var i = 0; i < objKeys.length; ++i) { for (var i = 0; i < objKeys.length; ++i) {
var key = objKeys[i]; var key = objKeys[i];
@ -257,7 +295,8 @@ module.exports = function (object, opts) {
options.format, options.format,
options.formatter, options.formatter,
options.encodeValuesOnly, options.encodeValuesOnly,
options.charset options.charset,
sideChannel
)); ));
} }

1
ui/node_modules/qs/lib/utils.js generated vendored

@ -177,6 +177,7 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
i += 1; i += 1;
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
/* eslint operator-linebreak: [2, "before"] */
out += hexTable[0xF0 | (c >> 18)] out += hexTable[0xF0 | (c >> 18)]
+ hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 12) & 0x3F)]
+ hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)]

28
ui/node_modules/qs/package.json generated vendored

@ -2,7 +2,7 @@
"name": "qs", "name": "qs",
"description": "A querystring parser that supports nesting and arrays, with a depth limit", "description": "A querystring parser that supports nesting and arrays, with a depth limit",
"homepage": "https://github.com/ljharb/qs", "homepage": "https://github.com/ljharb/qs",
"version": "6.9.6", "version": "6.10.3",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/ljharb/qs.git" "url": "https://github.com/ljharb/qs.git"
@ -29,34 +29,38 @@
"engines": { "engines": {
"node": ">=0.6" "node": ">=0.6"
}, },
"dependencies": {}, "dependencies": {
"side-channel": "^1.0.4"
},
"devDependencies": { "devDependencies": {
"@ljharb/eslint-config": "^17.3.0", "@ljharb/eslint-config": "^20.1.0",
"aud": "^1.1.3", "aud": "^1.1.5",
"browserify": "^16.5.2", "browserify": "^16.5.2",
"eclint": "^2.8.1", "eclint": "^2.8.1",
"eslint": "^7.17.0", "eslint": "^8.6.0",
"evalmd": "^0.0.19", "evalmd": "^0.0.19",
"for-each": "^0.3.3", "for-each": "^0.3.3",
"has-symbols": "^1.0.1", "has-symbols": "^1.0.2",
"iconv-lite": "^0.5.1", "iconv-lite": "^0.5.1",
"in-publish": "^2.0.1",
"mkdirp": "^0.5.5", "mkdirp": "^0.5.5",
"nyc": "^10.3.2", "nyc": "^10.3.2",
"object-inspect": "^1.9.0", "object-inspect": "^1.12.0",
"qs-iconv": "^1.0.4", "qs-iconv": "^1.0.4",
"safe-publish-latest": "^1.1.4", "safe-publish-latest": "^2.0.0",
"safer-buffer": "^2.1.2", "safer-buffer": "^2.1.2",
"tape": "^5.1.1" "tape": "^5.4.0"
}, },
"scripts": { "scripts": {
"prepublish": "safe-publish-latest && npm run dist", "prepublishOnly": "safe-publish-latest && npm run dist",
"prepublish": "not-in-publish || npm run prepublishOnly",
"pretest": "npm run --silent readme && npm run --silent lint", "pretest": "npm run --silent readme && npm run --silent lint",
"test": "npm run tests-only", "test": "npm run tests-only",
"tests-only": "nyc tape 'test/**/*.js'", "tests-only": "nyc tape 'test/**/*.js'",
"posttest": "aud --production", "posttest": "aud --production",
"readme": "evalmd README.md", "readme": "evalmd README.md",
"postlint": "eclint check * lib/* test/*", "postlint": "eclint check * lib/* test/* !dist/*",
"lint": "eslint lib/*.js test/*.js", "lint": "eslint .",
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js" "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
}, },
"license": "BSD-3-Clause", "license": "BSD-3-Clause",

69
ui/node_modules/qs/test/parse.js generated vendored

@ -269,6 +269,15 @@ test('parse()', function (t) {
st.end(); st.end();
}); });
t.test('parses sparse arrays', function (st) {
/* eslint no-sparse-arrays: 0 */
st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] });
st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] });
st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] });
st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] });
st.end();
});
t.test('parses semi-parsed strings', function (st) { t.test('parses semi-parsed strings', function (st) {
st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
@ -620,6 +629,66 @@ test('parse()', function (t) {
st.end(); st.end();
}); });
t.test('dunder proto is ignored', function (st) {
var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42';
var result = qs.parse(payload, { allowPrototypes: true });
st.deepEqual(
result,
{
categories: {
length: '42'
}
},
'silent [[Prototype]] payload'
);
var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true });
st.deepEqual(
plainResult,
{
__proto__: null,
categories: {
__proto__: null,
length: '42'
}
},
'silent [[Prototype]] payload: plain objects'
);
var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true });
st.notOk(Array.isArray(query.categories), 'is not an array');
st.notOk(query.categories instanceof Array, 'is not instanceof an array');
st.deepEqual(query.categories, { some: { json: 'toInject' } });
st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array');
st.deepEqual(
qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }),
{
foo: {
bar: 'stuffs'
}
},
'hidden values'
);
st.deepEqual(
qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }),
{
__proto__: null,
foo: {
__proto__: null,
bar: 'stuffs'
}
},
'hidden values: plain objects'
);
st.end();
});
t.test('can return null objects', { skip: !Object.create }, function (st) { t.test('can return null objects', { skip: !Object.create }, function (st) {
var expected = Object.create(null); var expected = Object.create(null);
expected.a = Object.create(null); expected.a = Object.create(null);

@ -132,10 +132,10 @@ test('stringify()', function (t) {
}); });
t.test('stringifies a nested array value', function (st) { t.test('stringifies a nested array value', function (st) {
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d');
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d'); st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d');
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'comma' }), 'a%5Bb%5D=c%2Cd'); // a[b]=c,d st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d');
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d');
st.end(); st.end();
}); });
@ -143,7 +143,7 @@ test('stringify()', function (t) {
st.equal( st.equal(
qs.stringify( qs.stringify(
{ a: { b: ['c', 'd'] } }, { a: { b: ['c', 'd'] } },
{ allowDots: true, encode: false, arrayFormat: 'indices' } { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }
), ),
'a.b[0]=c&a.b[1]=d', 'a.b[0]=c&a.b[1]=d',
'indices: stringifies with dots + indices' 'indices: stringifies with dots + indices'
@ -151,7 +151,7 @@ test('stringify()', function (t) {
st.equal( st.equal(
qs.stringify( qs.stringify(
{ a: { b: ['c', 'd'] } }, { a: { b: ['c', 'd'] } },
{ allowDots: true, encode: false, arrayFormat: 'brackets' } { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }
), ),
'a.b[]=c&a.b[]=d', 'a.b[]=c&a.b[]=d',
'brackets: stringifies with dots + brackets' 'brackets: stringifies with dots + brackets'
@ -159,7 +159,7 @@ test('stringify()', function (t) {
st.equal( st.equal(
qs.stringify( qs.stringify(
{ a: { b: ['c', 'd'] } }, { a: { b: ['c', 'd'] } },
{ allowDots: true, encode: false, arrayFormat: 'comma' } { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }
), ),
'a.b=c,d', 'a.b=c,d',
'comma: stringifies with dots + comma' 'comma: stringifies with dots + comma'
@ -167,7 +167,7 @@ test('stringify()', function (t) {
st.equal( st.equal(
qs.stringify( qs.stringify(
{ a: { b: ['c', 'd'] } }, { a: { b: ['c', 'd'] } },
{ allowDots: true, encode: false } { allowDots: true, encodeValuesOnly: true }
), ),
'a.b[0]=c&a.b[1]=d', 'a.b[0]=c&a.b[1]=d',
'default: stringifies with dots + indices' 'default: stringifies with dots + indices'
@ -215,17 +215,23 @@ test('stringify()', function (t) {
t.test('stringifies an array with mixed objects and primitives', function (st) { t.test('stringifies an array with mixed objects and primitives', function (st) {
st.equal( st.equal(
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }), qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }),
'a[0][b]=1&a[1]=2&a[2]=3', 'a[0][b]=1&a[1]=2&a[2]=3',
'indices => indices' 'indices => indices'
); );
st.equal( st.equal(
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }), qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
'a[][b]=1&a[]=2&a[]=3', 'a[][b]=1&a[]=2&a[]=3',
'brackets => brackets' 'brackets => brackets'
); );
st.equal( st.equal(
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }), qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }),
'???',
'brackets => brackets',
{ skip: 'TODO: figure out what this should do' }
);
st.equal(
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }),
'a[0][b]=1&a[1]=2&a[2]=3', 'a[0][b]=1&a[1]=2&a[2]=3',
'default => indices' 'default => indices'
); );
@ -433,7 +439,7 @@ test('stringify()', function (t) {
st.end(); st.end();
}); });
t.test('doesn\'t blow up when Buffer global is missing', function (st) { t.test('does not blow up when Buffer global is missing', function (st) {
var tempBuffer = global.Buffer; var tempBuffer = global.Buffer;
delete global.Buffer; delete global.Buffer;
var result = qs.stringify({ a: 'b', c: 'd' }); var result = qs.stringify({ a: 'b', c: 'd' });
@ -442,6 +448,57 @@ test('stringify()', function (t) {
st.end(); st.end();
}); });
t.test('does not crash when parsing circular references', function (st) {
var a = {};
a.b = a;
st['throws'](
function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); },
/RangeError: Cyclic object value/,
'cyclic values throw'
);
var circular = {
a: 'value'
};
circular.a = circular;
st['throws'](
function () { qs.stringify(circular); },
/RangeError: Cyclic object value/,
'cyclic values throw'
);
var arr = ['a'];
st.doesNotThrow(
function () { qs.stringify({ x: arr, y: arr }); },
'non-cyclic values do not throw'
);
st.end();
});
t.test('non-circular duplicated references can still work', function (st) {
var hourOfDay = {
'function': 'hour_of_day'
};
var p1 = {
'function': 'gte',
arguments: [hourOfDay, 0]
};
var p2 = {
'function': 'lte',
arguments: [hourOfDay, 23]
};
st.equal(
qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true }),
'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23'
);
st.end();
});
t.test('selects properties when filter=array', function (st) { t.test('selects properties when filter=array', function (st) {
st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
@ -784,7 +841,22 @@ test('stringify()', function (t) {
st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat');
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket'); st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket');
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices');
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), '???', 'array, comma (pending issue #378)', { skip: true }); st.equal(
qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }),
'???',
'array, comma',
{ skip: 'TODO: figure out what this should do' }
);
st.end();
});
t.test('stringifies sparse arrays', function (st) {
/* eslint no-sparse-arrays: 0 */
st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true }), 'a[1]=2&a[4]=1');
st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true }), 'a[1][b][2][c]=1');
st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c]=1');
st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c][1]=1');
st.end(); st.end();
}); });

@ -1,3 +1,22 @@
2.5.1 / 2022-02-28
==================
* Fix error on early async hooks implementations
2.5.0 / 2022-02-21
==================
* Prevent loss of async hooks context
* Prevent hanging when stream is not readable
* deps: http-errors@2.0.0
- deps: depd@2.0.0
- deps: statuses@2.0.1
2.4.3 / 2022-02-14
==================
* deps: bytes@3.1.2
2.4.2 / 2021-11-16 2.4.2 / 2021-11-16
================== ==================

2
ui/node_modules/raw-body/LICENSE generated vendored

@ -1,7 +1,7 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2013-2014 Jonathan Ong <me@jongleberry.com> Copyright (c) 2013-2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com> Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

@ -61,8 +61,10 @@ You can also pass a string in place of options to just specify the encoding.
If an error occurs, the stream will be paused, everything unpiped, If an error occurs, the stream will be paused, everything unpiped,
and you are responsible for correctly disposing the stream. and you are responsible for correctly disposing the stream.
For HTTP requests, no handling is required if you send a response. For HTTP requests, you may need to finish consuming the stream if
For streams that use file descriptors, you should `stream.destroy()` or `stream.close()` to prevent leaks. you want to keep the socket open for future requests. For streams
that use file descriptors, you should `stream.destroy()` or
`stream.close()` to prevent leaks.
## Errors ## Errors
@ -79,7 +81,7 @@ otherwise an error created by this module, which has the following attributes:
### Types ### Types
The errors from this module have a `type` property which allows for the progamatic The errors from this module have a `type` property which allows for the programmatic
determination of the type of error returned. determination of the type of error returned.
#### encoding.unsupported #### encoding.unsupported
@ -109,6 +111,10 @@ This error will occur when the given stream has an encoding set on it, making it
a decoded stream. The stream should not have an encoding set and is expected to a decoded stream. The stream should not have an encoding set and is expected to
emit `Buffer` objects. emit `Buffer` objects.
#### stream.not.readable
This error will occur when the given stream is not readable.
## Examples ## Examples
### Simple Express example ### Simple Express example

47
ui/node_modules/raw-body/index.js generated vendored

@ -1,7 +1,7 @@
/*! /*!
* raw-body * raw-body
* Copyright(c) 2013-2014 Jonathan Ong * Copyright(c) 2013-2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson * Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed * MIT Licensed
*/ */
@ -12,6 +12,7 @@
* @private * @private
*/ */
var asyncHooks = tryRequireAsyncHooks()
var bytes = require('bytes') var bytes = require('bytes')
var createError = require('http-errors') var createError = require('http-errors')
var iconv = require('iconv-lite') var iconv = require('iconv-lite')
@ -105,7 +106,7 @@ function getRawBody (stream, options, callback) {
if (done) { if (done) {
// classic callback style // classic callback style
return readStream(stream, encoding, length, limit, done) return readStream(stream, encoding, length, limit, wrap(done))
} }
return new Promise(function executor (resolve, reject) { return new Promise(function executor (resolve, reject) {
@ -173,6 +174,12 @@ function readStream (stream, encoding, length, limit, callback) {
})) }))
} }
if (typeof stream.readable !== 'undefined' && !stream.readable) {
return done(createError(500, 'stream is not readable', {
type: 'stream.not.readable'
}))
}
var received = 0 var received = 0
var decoder var decoder
@ -284,3 +291,39 @@ function readStream (stream, encoding, length, limit, callback) {
stream.removeListener('close', cleanup) stream.removeListener('close', cleanup)
} }
} }
/**
* Try to require async_hooks
* @private
*/
function tryRequireAsyncHooks () {
try {
return require('async_hooks')
} catch (e) {
return {}
}
}
/**
* Wrap function with async resource, if possible.
* AsyncResource.bind static method backported.
* @private
*/
function wrap (fn) {
var res
// create anonymous resource
if (asyncHooks.AsyncResource) {
res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')
}
// incompatible node.js
if (!res || !res.runInAsyncScope) {
return fn
}
// return bound function
return res.runInAsyncScope.bind(res, fn, null)
}

@ -1,7 +1,7 @@
{ {
"name": "raw-body", "name": "raw-body",
"description": "Get and validate the raw body of a readable stream.", "description": "Get and validate the raw body of a readable stream.",
"version": "2.4.2", "version": "2.5.1",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", "author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"contributors": [ "contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>", "Douglas Christopher Wilson <doug@somethingdoug.com>",
@ -10,8 +10,8 @@
"license": "MIT", "license": "MIT",
"repository": "stream-utils/raw-body", "repository": "stream-utils/raw-body",
"dependencies": { "dependencies": {
"bytes": "3.1.1", "bytes": "3.1.2",
"http-errors": "1.8.1", "http-errors": "2.0.0",
"iconv-lite": "0.4.24", "iconv-lite": "0.4.24",
"unpipe": "1.0.0" "unpipe": "1.0.0"
}, },
@ -19,12 +19,12 @@
"bluebird": "3.7.2", "bluebird": "3.7.2",
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-config-standard": "14.1.1", "eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.1", "eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0", "eslint-plugin-standard": "4.1.0",
"mocha": "9.1.3", "mocha": "9.2.1",
"nyc": "15.1.0", "nyc": "15.1.0",
"readable-stream": "2.3.7", "readable-stream": "2.3.7",
"safe-buffer": "5.2.1" "safe-buffer": "5.2.1"
@ -36,13 +36,14 @@
"HISTORY.md", "HISTORY.md",
"LICENSE", "LICENSE",
"README.md", "README.md",
"SECURITY.md",
"index.d.ts", "index.d.ts",
"index.js" "index.js"
], ],
"scripts": { "scripts": {
"lint": "eslint .", "lint": "eslint .",
"test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/", "test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test", "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test" "test-cov": "nyc --reporter=html --reporter=text npm test"
} }
} }

15
ui/node_modules/send/HISTORY.md generated vendored

@ -1,3 +1,18 @@
0.18.0 / 2022-03-23
===================
* Fix emitted 416 error missing headers property
* Limit the headers removed for 304 response
* deps: depd@2.0.0
- Replace internal `eval` usage with `Function` constructor
- Use instance methods on `process` to check for listeners
* deps: destroy@1.2.0
* deps: http-errors@2.0.0
- deps: depd@2.0.0
- deps: statuses@2.0.1
* deps: on-finished@2.4.1
* deps: statuses@2.0.1
0.17.2 / 2021-12-11 0.17.2 / 2021-12-11
=================== ===================

2
ui/node_modules/send/LICENSE generated vendored

@ -1,7 +1,7 @@
(The MIT License) (The MIT License)
Copyright (c) 2012 TJ Holowaychuk Copyright (c) 2012 TJ Holowaychuk
Copyright (c) 2014-2016 Douglas Christopher Wilson Copyright (c) 2014-2022 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

4
ui/node_modules/send/README.md generated vendored

@ -318,8 +318,8 @@ server.listen(3000)
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send [appveyor-url]: https://ci.appveyor.com/project/dougwilson/send
[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master [coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master
[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master [coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master
[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=ci [github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux
[github-actions-ci-url]: https://github.com/pillarjs/send/actions?query=workflow%3Aci [github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml
[node-image]: https://badgen.net/npm/node/send [node-image]: https://badgen.net/npm/node/send
[node-url]: https://nodejs.org/en/download/ [node-url]: https://nodejs.org/en/download/
[npm-downloads-image]: https://badgen.net/npm/dm/send [npm-downloads-image]: https://badgen.net/npm/dm/send

64
ui/node_modules/send/index.js generated vendored

@ -1,7 +1,7 @@
/*! /*!
* send * send
* Copyright(c) 2012 TJ Holowaychuk * Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2014-2016 Douglas Christopher Wilson * Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed * MIT Licensed
*/ */
@ -267,13 +267,11 @@ SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) {
SendStream.prototype.error = function error (status, err) { SendStream.prototype.error = function error (status, err) {
// emit if listeners instead of responding // emit if listeners instead of responding
if (hasListeners(this, 'error')) { if (hasListeners(this, 'error')) {
return this.emit('error', createError(status, err, { return this.emit('error', createHttpError(status, err))
expose: false
}))
} }
var res = this.res var res = this.res
var msg = statuses[status] || String(status) var msg = statuses.message[status] || String(status)
var doc = createHtmlDocument('Error', escapeHtml(msg)) var doc = createHtmlDocument('Error', escapeHtml(msg))
// clear existing headers // clear existing headers
@ -349,21 +347,19 @@ SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () {
} }
/** /**
* Strip content-* header fields. * Strip various content header fields for a change in entity.
* *
* @private * @private
*/ */
SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () {
var res = this.res var res = this.res
var headers = getHeaderNames(res)
for (var i = 0; i < headers.length; i++) { res.removeHeader('Content-Encoding')
var header = headers[i] res.removeHeader('Content-Language')
if (header.substr(0, 8) === 'content-' && header !== 'content-location') { res.removeHeader('Content-Length')
res.removeHeader(header) res.removeHeader('Content-Range')
} res.removeHeader('Content-Type')
}
} }
/** /**
@ -787,8 +783,6 @@ SendStream.prototype.sendIndex = function sendIndex (path) {
*/ */
SendStream.prototype.stream = function stream (path, options) { SendStream.prototype.stream = function stream (path, options) {
// TODO: this is all lame, refactor meeee
var finished = false
var self = this var self = this
var res = this.res var res = this.res
@ -797,20 +791,18 @@ SendStream.prototype.stream = function stream (path, options) {
this.emit('stream', stream) this.emit('stream', stream)
stream.pipe(res) stream.pipe(res)
// response finished, done with the fd // cleanup
onFinished(res, function onfinished () { function cleanup () {
finished = true destroy(stream, true)
destroy(stream) }
})
// error handling code-smell // response finished, cleanup
stream.on('error', function onerror (err) { onFinished(res, cleanup)
// request already finished
if (finished) return
// clean up stream // error handling
finished = true stream.on('error', function onerror (err) {
destroy(stream) // clean up stream early
cleanup()
// error // error
self.onStatError(err) self.onStatError(err)
@ -974,6 +966,24 @@ function createHtmlDocument (title, body) {
'</html>\n' '</html>\n'
} }
/**
* Create a HttpError object from simple arguments.
*
* @param {number} status
* @param {Error|object} err
* @private
*/
function createHttpError (status, err) {
if (!err) {
return createError(status)
}
return err instanceof Error
? createError(status, err, { expose: false })
: createError(status, err)
}
/** /**
* decodeURIComponent. * decodeURIComponent.
* *

19
ui/node_modules/send/package.json generated vendored

@ -1,7 +1,7 @@
{ {
"name": "send", "name": "send",
"description": "Better streaming static file server with Range and conditional-GET support", "description": "Better streaming static file server with Range and conditional-GET support",
"version": "0.17.2", "version": "0.18.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>", "author": "TJ Holowaychuk <tj@vision-media.ca>",
"contributors": [ "contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>", "Douglas Christopher Wilson <doug@somethingdoug.com>",
@ -17,36 +17,37 @@
], ],
"dependencies": { "dependencies": {
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "2.0.0",
"destroy": "~1.0.4", "destroy": "1.2.0",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"etag": "~1.8.1", "etag": "~1.8.1",
"fresh": "0.5.2", "fresh": "0.5.2",
"http-errors": "1.8.1", "http-errors": "2.0.0",
"mime": "1.6.0", "mime": "1.6.0",
"ms": "2.1.3", "ms": "2.1.3",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"range-parser": "~1.2.1", "range-parser": "~1.2.1",
"statuses": "~1.5.0" "statuses": "2.0.1"
}, },
"devDependencies": { "devDependencies": {
"after": "0.8.2", "after": "0.8.2",
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-config-standard": "14.1.1", "eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0", "eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0", "eslint-plugin-standard": "4.1.0",
"mocha": "9.1.3", "mocha": "9.2.2",
"nyc": "15.1.0", "nyc": "15.1.0",
"supertest": "6.1.6" "supertest": "6.2.2"
}, },
"files": [ "files": [
"HISTORY.md", "HISTORY.md",
"LICENSE", "LICENSE",
"README.md", "README.md",
"SECURITY.md",
"index.js" "index.js"
], ],
"engines": { "engines": {

@ -1,3 +1,15 @@
1.15.0 / 2022-03-24
===================
* deps: send@0.18.0
- Fix emitted 416 error missing headers property
- Limit the headers removed for 304 response
- deps: depd@2.0.0
- deps: destroy@1.2.0
- deps: http-errors@2.0.0
- deps: on-finished@2.4.1
- deps: statuses@2.0.1
1.14.2 / 2021-12-15 1.14.2 / 2021-12-15
=================== ===================

@ -249,7 +249,7 @@ function setCustomCacheControl (res, path) {
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master [coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master
[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master [coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master
[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux [github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux
[github-actions-ci-url]: https://github.com/expressjs/serve-static/actions?query=workflow%3Aci [github-actions-ci-url]: https://github.com/expressjs/serve-static/actions/workflows/ci.yml
[node-image]: https://badgen.net/npm/node/serve-static [node-image]: https://badgen.net/npm/node/serve-static
[node-url]: https://nodejs.org/en/download/ [node-url]: https://nodejs.org/en/download/
[npm-downloads-image]: https://badgen.net/npm/dm/serve-static [npm-downloads-image]: https://badgen.net/npm/dm/serve-static

@ -1,7 +1,7 @@
{ {
"name": "serve-static", "name": "serve-static",
"description": "Serve static files", "description": "Serve static files",
"version": "1.14.2", "version": "1.15.0",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>", "author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
"license": "MIT", "license": "MIT",
"repository": "expressjs/serve-static", "repository": "expressjs/serve-static",
@ -9,20 +9,20 @@
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"send": "0.17.2" "send": "0.18.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-config-standard": "14.1.1", "eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0", "eslint-plugin-promise": "5.2.0",
"eslint-plugin-standard": "4.1.0", "eslint-plugin-standard": "4.1.0",
"mocha": "9.1.3", "mocha": "9.2.2",
"nyc": "15.1.0", "nyc": "15.1.0",
"safe-buffer": "5.2.1", "safe-buffer": "5.2.1",
"supertest": "6.1.6" "supertest": "6.2.2"
}, },
"files": [ "files": [
"LICENSE", "LICENSE",

1237
ui/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -2,8 +2,12 @@
"dependencies": { "dependencies": {
"body-parser": "^1.19.1", "body-parser": "^1.19.1",
"execute": "^0.1.0", "execute": "^0.1.0",
"express": "^4.17.2",
"multer": "^1.4.4", "multer": "^1.4.4",
"mysql": "^2.18.1" "mysql": "^2.18.1"
},
"devDependencies": {
"connect-timeout": "^1.9.0",
"express": "^4.18.1",
"http-proxy-middleware": "^2.0.6"
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

@ -6,7 +6,7 @@
<input type="submit" value="上传文件" /> <input type="submit" value="上传文件" />
</form> </form>
<br /> <br />
<form action="/check" method="post"> <form action="/check" >
<input type="submit" value="测试" /> <input type="submit" value="测试" />
</form> </form>

@ -0,0 +1,383 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style>
*{
margin:0;
padding:0;
font-size: 13px;
font-family: "Microsoft YaHei";
}
html,body{
width:100%;
height:100%;
background: #fff;
}
#container {
width:100%;
height:100%;
position:fixed;
top:0;
left:0;
z-index: 999;
}
#output {
width: 100%;
height: 100%;
}
.prompt{
width:60%;
height:30px;
margin:5px auto;
text-align: center;
line-height: 30px;
font-family: "Microsoft YaHei", Arial, sans-serif;
font-size: 13px;
color: #df0000;
}
.containerT {
width:400px;
height:300PX;
text-align: center;
position: absolute;
top:50%;
left:50%;
margin:-150px 0 0 -200px;
border-radius: 3px;
}
.containerT h1 {
font-size:18px;
font-family: "Microsoft YaHei", Arial, sans-serif;
-webkit-transition-duration: 1s;
transition-duration: 1s;
-webkit-transition-timing-function: ease-in-put;
transition-timing-function: ease-in-put;
font-weight:500;
}
form {
padding: 20px 0;
position: relative;
z-index: 2;
}
form input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: 0;
border: 1px solid rgba(255, 255, 255, 0.4);
background-color: rgba(255, 255, 255, 0.2);
width: 200px;
border-radius: 3px;
padding: 8px 15px;
margin: 0 auto 10px auto;
display: block;
text-align: center;
font-size:15px;
color: white;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
font-weight: 300;
}
form input:hover {
background-color: rgba(255, 255, 255, 0.4);
}
form input:focus {
background-color: white;
width:230px;
color: #333;
}
form button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
outline: 0;
background-color: white;
border: 0;
padding: 10px 15px;
color: #333;
border-radius: 3px;
width: 200px;
cursor: pointer;
font-family: "Microsoft YaHei", Arial, sans-serif;
font-size: 16px;
font-weight: 700;
-webkit-transition-duration: 0.25s;
transition-duration: 0.25s;
}
form button:hover {
background-color: #f5f7f9;
}
</style>
<script type="text/javascript" src="https://repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" >
CAV={FRONT:0,BACK:1,DOUBLE:2,SVGNS:"http://www.w3.org/2000/svg"};CAV.Array=typeof Float32Array==="function"?Float32Array:Array;CAV.Utils={isNumber:function(a){return!isNaN(parseFloat(a))&&isFinite(a)}};
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];if(!window.requestAnimationFrame)window.requestAnimationFrame=function(b){var c=(new Date).getTime(),f=Math.max(0,16-(c-a)),g=window.setTimeout(function(){b(c+f)},f);a=c+f;return g};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
function(a){clearTimeout(a)}})();Math.PIM2=Math.PI*2;Math.PID2=Math.PI/2;Math.randomInRange=function(a,b){return a+(b-a)*Math.random()};Math.clamp=function(a,b,c){a=Math.max(a,b);return a=Math.min(a,c)};
CAV.Vector3={create:function(a,b,c){var d=new CAV.Array(3);this.set(d,a,b,c);return d},clone:function(a){var b=this.create();this.copy(b,a);return b},set:function(a,b,c,d){a[0]=b||0;a[1]=c||0;a[2]=d||0;return this},setX:function(a,b){a[0]=b||0;return this},setY:function(a,b){a[1]=b||0;return this},setZ:function(a,b){a[2]=b||0;return this},copy:function(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];return this},add:function(a,b){a[0]+=b[0];a[1]+=b[1];a[2]+=b[2];return this},addVectors:function(a,b,c){a[0]=b[0]+
c[0];a[1]=b[1]+c[1];a[2]=b[2]+c[2];return this},addScalar:function(a,b){a[0]+=b;a[1]+=b;a[2]+=b;return this},subtract:function(a,b){a[0]-=b[0];a[1]-=b[1];a[2]-=b[2];return this},subtractVectors:function(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]-c[1];a[2]=b[2]-c[2];return this},subtractScalar:function(a,b){a[0]-=b;a[1]-=b;a[2]-=b;return this},multiply:function(a,b){a[0]*=b[0];a[1]*=b[1];a[2]*=b[2];return this},multiplyVectors:function(a,b,c){a[0]=b[0]*c[0];a[1]=b[1]*c[1];a[2]=b[2]*c[2];return this},multiplyScalar:function(a,
b){a[0]*=b;a[1]*=b;a[2]*=b;return this},divide:function(a,b){a[0]/=b[0];a[1]/=b[1];a[2]/=b[2];return this},divideVectors:function(a,b,c){a[0]=b[0]/c[0];a[1]=b[1]/c[1];a[2]=b[2]/c[2];return this},divideScalar:function(a,b){b!==0?(a[0]/=b,a[1]/=b,a[2]/=b):(a[0]=0,a[1]=0,a[2]=0);return this},cross:function(a,b){var c=a[0],d=a[1],e=a[2];a[0]=d*b[2]-e*b[1];a[1]=e*b[0]-c*b[2];a[2]=c*b[1]-d*b[0];return this},crossVectors:function(a,b,c){a[0]=b[1]*c[2]-b[2]*c[1];a[1]=b[2]*c[0]-b[0]*c[2];a[2]=b[0]*c[1]-b[1]*
c[0];return this},min:function(a,b){a[0]<b&&(a[0]=b);a[1]<b&&(a[1]=b);a[2]<b&&(a[2]=b);return this},max:function(a,b){a[0]>b&&(a[0]=b);a[1]>b&&(a[1]=b);a[2]>b&&(a[2]=b);return this},clamp:function(a,b,c){this.min(a,b);this.max(a,c);return this},limit:function(a,b,c){var d=this.length(a);b!==null&&d<b?this.setLength(a,b):c!==null&&d>c&&this.setLength(a,c);return this},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},normalise:function(a){return this.divideScalar(a,this.length(a))},negate:function(a){return this.multiplyScalar(a,
-1)},distanceSquared:function(a,b){var c=a[0]-b[0],d=a[1]-b[1],e=a[2]-b[2];return c*c+d*d+e*e},distance:function(a,b){return Math.sqrt(this.distanceSquared(a,b))},lengthSquared:function(a){return a[0]*a[0]+a[1]*a[1]+a[2]*a[2]},length:function(a){return Math.sqrt(this.lengthSquared(a))},setLength:function(a,b){var c=this.length(a);c!==0&&b!==c&&this.multiplyScalar(a,b/c);return this}};
CAV.Vector4={create:function(a,b,c){var d=new CAV.Array(4);this.set(d,a,b,c);return d},set:function(a,b,c,d,e){a[0]=b||0;a[1]=c||0;a[2]=d||0;a[3]=e||0;return this},setX:function(a,b){a[0]=b||0;return this},setY:function(a,b){a[1]=b||0;return this},setZ:function(a,b){a[2]=b||0;return this},setW:function(a,b){a[3]=b||0;return this},add:function(a,b){a[0]+=b[0];a[1]+=b[1];a[2]+=b[2];a[3]+=b[3];return this},multiplyVectors:function(a,b,c){a[0]=b[0]*c[0];a[1]=b[1]*c[1];a[2]=b[2]*c[2];a[3]=b[3]*c[3];return this},
multiplyScalar:function(a,b){a[0]*=b;a[1]*=b;a[2]*=b;a[3]*=b;return this},min:function(a,b){a[0]<b&&(a[0]=b);a[1]<b&&(a[1]=b);a[2]<b&&(a[2]=b);a[3]<b&&(a[3]=b);return this},max:function(a,b){a[0]>b&&(a[0]=b);a[1]>b&&(a[1]=b);a[2]>b&&(a[2]=b);a[3]>b&&(a[3]=b);return this},clamp:function(a,b,c){this.min(a,b);this.max(a,c);return this}};CAV.Color=function(a,b){this.rgba=CAV.Vector4.create();this.hex=a||"#000000";this.opacity=CAV.Utils.isNumber(b)?b:1;this.set(this.hex,this.opacity)};
CAV.Color.prototype={set:function(a,b){var a=a.replace("#",""),c=a.length/3;this.rgba[0]=parseInt(a.substring(c*0,c*1),16)/255;this.rgba[1]=parseInt(a.substring(c*1,c*2),16)/255;this.rgba[2]=parseInt(a.substring(c*2,c*3),16)/255;this.rgba[3]=CAV.Utils.isNumber(b)?b:this.rgba[3];return this},hexify:function(a){a=Math.ceil(a*255).toString(16);a.length===1&&(a="0"+a);return a},format:function(){var a=this.hexify(this.rgba[0]),b=this.hexify(this.rgba[1]),c=this.hexify(this.rgba[2]);return this.hex="#"+
a+b+c}};CAV.Object=function(){this.position=CAV.Vector3.create()};CAV.Object.prototype={setPosition:function(a,b,c){CAV.Vector3.set(this.position,a,b,c);return this}};CAV.Light=function(a,b){CAV.Object.call(this);this.ambient=new CAV.Color(a||"#FFFFFF");this.diffuse=new CAV.Color(b||"#FFFFFF");this.ray=CAV.Vector3.create()};CAV.Light.prototype=Object.create(CAV.Object.prototype);CAV.Vertex=function(a,b,c){this.position=CAV.Vector3.create(a,b,c)};
CAV.Vertex.prototype={setPosition:function(a,b,c){CAV.Vector3.set(this.position,a,b,c);return this}};
CAV.Triangle=function(a,b,c){this.a=a||new CAV.Vertex;this.b=b||new CAV.Vertex;this.c=c||new CAV.Vertex;this.vertices=[this.a,this.b,this.c];this.u=CAV.Vector3.create();this.v=CAV.Vector3.create();this.centroid=CAV.Vector3.create();this.normal=CAV.Vector3.create();this.color=new CAV.Color;this.polygon=document.createElementNS(CAV.SVGNS,"polygon");this.polygon.setAttributeNS(null,"stroke-linejoin","round");this.polygon.setAttributeNS(null,"stroke-miterlimit","1");this.polygon.setAttributeNS(null,"stroke-width",
"1");this.computeCentroid();this.computeNormal()};
CAV.Triangle.prototype={computeCentroid:function(){this.centroid[0]=this.a.position[0]+this.b.position[0]+this.c.position[0];this.centroid[1]=this.a.position[1]+this.b.position[1]+this.c.position[1];this.centroid[2]=this.a.position[2]+this.b.position[2]+this.c.position[2];CAV.Vector3.divideScalar(this.centroid,3);return this},computeNormal:function(){CAV.Vector3.subtractVectors(this.u,this.b.position,this.a.position);CAV.Vector3.subtractVectors(this.v,this.c.position,this.a.position);CAV.Vector3.crossVectors(this.normal,
this.u,this.v);CAV.Vector3.normalise(this.normal);return this}};CAV.Geometry=function(){this.vertices=[];this.triangles=[];this.dirty=false};CAV.Geometry.prototype={update:function(){if(this.dirty){var a,b;for(a=this.triangles.length-1;a>=0;a--)b=this.triangles[a],b.computeCentroid(),b.computeNormal();this.dirty=false}return this}};
CAV.Plane=function(a,b,c,d){CAV.Geometry.call(this);this.width=a||100;this.height=b||100;this.segments=c||4;this.slices=d||4;this.segmentWidth=this.width/this.segments;this.sliceHeight=this.height/this.slices;var e,f,g,c=[];e=this.width*-0.5;f=this.height*0.5;for(a=0;a<=this.segments;a++){c.push([]);for(b=0;b<=this.slices;b++)d=new CAV.Vertex(e+a*this.segmentWidth,f-b*this.sliceHeight),c[a].push(d),this.vertices.push(d)}for(a=0;a<this.segments;a++)for(b=0;b<this.slices;b++)d=c[a+0][b+0],e=c[a+0][b+
1],f=c[a+1][b+0],g=c[a+1][b+1],t0=new CAV.Triangle(d,e,f),t1=new CAV.Triangle(f,e,g),this.triangles.push(t0,t1)};CAV.Plane.prototype=Object.create(CAV.Geometry.prototype);CAV.Material=function(a,b){this.ambient=new CAV.Color(a||"#444444");this.diffuse=new CAV.Color(b||"#FFFFFF");this.slave=new CAV.Color};CAV.Mesh=function(a,b){CAV.Object.call(this);this.geometry=a||new CAV.Geometry;this.material=b||new CAV.Material;this.side=CAV.FRONT;this.visible=true};CAV.Mesh.prototype=Object.create(CAV.Object.prototype);
CAV.Mesh.prototype.update=function(a,b){var c,d,e,f,g;this.geometry.update();if(b)for(c=this.geometry.triangles.length-1;c>=0;c--){d=this.geometry.triangles[c];CAV.Vector4.set(d.color.rgba);for(e=a.length-1;e>=0;e--)f=a[e],CAV.Vector3.subtractVectors(f.ray,f.position,d.centroid),CAV.Vector3.normalise(f.ray),g=CAV.Vector3.dot(d.normal,f.ray),this.side===CAV.FRONT?g=Math.max(g,0):this.side===CAV.BACK?g=Math.abs(Math.min(g,0)):this.side===CAV.DOUBLE&&(g=Math.max(Math.abs(g),0)),CAV.Vector4.multiplyVectors(this.material.slave.rgba,
this.material.ambient.rgba,f.ambient.rgba),CAV.Vector4.add(d.color.rgba,this.material.slave.rgba),CAV.Vector4.multiplyVectors(this.material.slave.rgba,this.material.diffuse.rgba,f.diffuse.rgba),CAV.Vector4.multiplyScalar(this.material.slave.rgba,g),CAV.Vector4.add(d.color.rgba,this.material.slave.rgba);CAV.Vector4.clamp(d.color.rgba,0,1)}return this};CAV.Scene=function(){this.meshes=[];this.lights=[]};
CAV.Scene.prototype={add:function(a){a instanceof CAV.Mesh&&!~this.meshes.indexOf(a)?this.meshes.push(a):a instanceof CAV.Light&&!~this.lights.indexOf(a)&&this.lights.push(a);return this},remove:function(a){a instanceof CAV.Mesh&&~this.meshes.indexOf(a)?this.meshes.splice(this.meshes.indexOf(a),1):a instanceof CAV.Light&&~this.lights.indexOf(a)&&this.lights.splice(this.lights.indexOf(a),1);return this}};CAV.Renderer=function(){this.halfHeight=this.halfWidth=this.height=this.width=0};
CAV.Renderer.prototype={setSize:function(a,b){if(!(this.width===a&&this.height===b))return this.width=a,this.height=b,this.halfWidth=this.width*0.5,this.halfHeight=this.height*0.5,this},clear:function(){return this},render:function(){return this}};CAV.CanvasRenderer=function(){CAV.Renderer.call(this);this.element=document.createElement("canvas");this.element.style.display="block";this.context=this.element.getContext("2d");this.setSize(this.element.width,this.element.height)};
CAV.CanvasRenderer.prototype=Object.create(CAV.Renderer.prototype);CAV.CanvasRenderer.prototype.setSize=function(a,b){CAV.Renderer.prototype.setSize.call(this,a,b);this.element.width=a;this.element.height=b;this.context.setTransform(1,0,0,-1,this.halfWidth,this.halfHeight);return this};CAV.CanvasRenderer.prototype.clear=function(){CAV.Renderer.prototype.clear.call(this);this.context.clearRect(-this.halfWidth,-this.halfHeight,this.width,this.height);return this};
CAV.CanvasRenderer.prototype.render=function(a){CAV.Renderer.prototype.render.call(this,a);var b,c,d,e,f;this.clear();this.context.lineJoin="round";this.context.lineWidth=1;for(b=a.meshes.length-1;b>=0;b--)if(c=a.meshes[b],c.visible){c.update(a.lights,true);for(d=c.geometry.triangles.length-1;d>=0;d--)e=c.geometry.triangles[d],f=e.color.format(),this.context.beginPath(),this.context.moveTo(e.a.position[0],e.a.position[1]),this.context.lineTo(e.b.position[0],e.b.position[1]),this.context.lineTo(e.c.position[0],
e.c.position[1]),this.context.closePath(),this.context.strokeStyle=f,this.context.fillStyle=f,this.context.stroke(),this.context.fill()}return this};
function Victor(container, anitOut){
if (!!document.createElement("canvas").getContext) {
var t = {
width: 1.5,
height: 1.5,
depth: 10,
segments: 12,
slices: 6,
xRange: 0.8,
yRange: 0.1,
zRange: 1,
ambient: "#525252",
diffuse: "#A5A5A5",
speed: 0.0002
};
var G = {
count: 2,
xyScalar: 1,
zOffset: 100,
ambient: "#1c8bff",
diffuse: "#1c8bff",
speed: 0.001,
gravity: 1200,
dampening: 0.95,
minLimit: 10,
maxLimit: null,
minDistance: 20,
maxDistance: 400,
autopilot: false,
draw: false,
bounds: CAV.Vector3.create(),
step: CAV.Vector3.create(Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1))
};
var m = "canvas";
var E = "svg";
var x = {
renderer: m
};
var i, n = Date.now();
var L = CAV.Vector3.create();
var k = CAV.Vector3.create();
var z = document.getElementById(container || "container");
var w = document.getElementById(anitOut || "anitOut");
var D, I, h, q, y;
var g;
var r;
function C() {
F();
p();
s();
B();
v();
K(z.offsetWidth, z.offsetHeight);
o()
}
function F() {
g = new CAV.CanvasRenderer();
H(x.renderer)
}
function H(N) {
if (D) {
w.removeChild(D.element)
}
switch (N) {
case m:
D = g;
break
}
D.setSize(z.offsetWidth, z.offsetHeight);
w.appendChild(D.element)
}
function p() {
I = new CAV.Scene()
}
function s() {
I.remove(h);
D.clear();
q = new CAV.Plane(t.width * D.width, t.height * D.height, t.segments, t.slices);
y = new CAV.Material(t.ambient, t.diffuse);
h = new CAV.Mesh(q, y);
I.add(h);
var N, O;
for (N = q.vertices.length - 1; N >= 0; N--) {
O = q.vertices[N];
O.anchor = CAV.Vector3.clone(O.position);
O.step = CAV.Vector3.create(Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1));
O.time = Math.randomInRange(0, Math.PIM2)
}
}
function B() {
var O, N;
for (O = I.lights.length - 1; O >= 0; O--) {
N = I.lights[O];
I.remove(N)
}
D.clear();
for (O = 0; O < G.count; O++) {
N = new CAV.Light(G.ambient, G.diffuse);
N.ambientHex = N.ambient.format();
N.diffuseHex = N.diffuse.format();
I.add(N);
N.mass = Math.randomInRange(0.5, 1);
N.velocity = CAV.Vector3.create();
N.acceleration = CAV.Vector3.create();
N.force = CAV.Vector3.create()
}
}
function K(O, N) {
D.setSize(O, N);
CAV.Vector3.set(L, D.halfWidth, D.halfHeight);
s()
}
function o() {
i = Date.now() - n;
u();
M();
requestAnimationFrame(o)
}
function u() {
var Q, P, O, R, T, V, U, S = t.depth / 2;
CAV.Vector3.copy(G.bounds, L);
CAV.Vector3.multiplyScalar(G.bounds, G.xyScalar);
CAV.Vector3.setZ(k, G.zOffset);
for (R = I.lights.length - 1; R >= 0; R--) {
T = I.lights[R];
CAV.Vector3.setZ(T.position, G.zOffset);
var N = Math.clamp(CAV.Vector3.distanceSquared(T.position, k), G.minDistance, G.maxDistance);
var W = G.gravity * T.mass / N;
CAV.Vector3.subtractVectors(T.force, k, T.position);
CAV.Vector3.normalise(T.force);
CAV.Vector3.multiplyScalar(T.force, W);
CAV.Vector3.set(T.acceleration);
CAV.Vector3.add(T.acceleration, T.force);
CAV.Vector3.add(T.velocity, T.acceleration);
CAV.Vector3.multiplyScalar(T.velocity, G.dampening);
CAV.Vector3.limit(T.velocity, G.minLimit, G.maxLimit);
CAV.Vector3.add(T.position, T.velocity)
}
for (V = q.vertices.length - 1; V >= 0; V--) {
U = q.vertices[V];
Q = Math.sin(U.time + U.step[0] * i * t.speed);
P = Math.cos(U.time + U.step[1] * i * t.speed);
O = Math.sin(U.time + U.step[2] * i * t.speed);
CAV.Vector3.set(U.position, t.xRange * q.segmentWidth * Q, t.yRange * q.sliceHeight * P, t.zRange * S * O - S);
CAV.Vector3.add(U.position, U.anchor)
}
q.dirty = true
}
function M() {
D.render(I)
}
function J(O) {
var Q, N, S = O;
var P = function(T) {
for (Q = 0, l = I.lights.length; Q < l; Q++) {
N = I.lights[Q];
N.ambient.set(T);
N.ambientHex = N.ambient.format()
}
};
var R = function(T) {
for (Q = 0, l = I.lights.length; Q < l; Q++) {
N = I.lights[Q];
N.diffuse.set(T);
N.diffuseHex = N.diffuse.format()
}
};
return {
set: function() {
P(S[0]);
R(S[1])
}
}
}
function v() {
window.addEventListener("resize", j)
}
function A(N) {
CAV.Vector3.set(k, N.x, D.height - N.y);
CAV.Vector3.subtract(k, L)
}
function j(N) {
K(z.offsetWidth, z.offsetHeight);
M()
}
C();
}
return J;
}
</script>
</head>
<body>
<div id="container">
<div id="output">
<div class="containerT">
<div class="title"><p style="color:rgba(255, 255, 255, 0.979); font-size:20px">开始分布式爬虫测试</p></div>
<form action="/check" method="get" enctype="multipart/form-data">
<label><input type="text" name="logo" placeholder="用户查找话题" class="from-control"/><br></label>
<input type="submit" value="测试结果"><br>
<iframe name="hideUrl" style="width:0px;height:0px;visibility:hidden;"></iframe>
</form>
<form action="/check1" enctype="multipart/form-data">
<input type="submit" value="查看历史记录"><br>
<iframe name="hideUrl" style="width:0px;height:0px;visibility:hidden;"></iframe>
</form>
<form action="/cook" method="post" enctype="multipart/form-data">
<input type="submit" value="更改用户信息">
<iframe name="hideUrl" style="width:0px;height:0px;visibility:hidden;"></iframe>
</form>
<form action="/cook2" method="post" enctype="multipart/form-data">
<input type="submit" value="登出">
</form>
</div>
<script type="text/javascript">
$(function(){
Victor("container", "output"); //登陆背景函数
$("#entry_name").focus();
$(document).keydown(function(event){
if(event.keyCode==13){
$("#entry_btn").click();
}
});
});
</script>
</body>
</html>

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UserInfo</title>
<style type="text/css">
.Content-Main{
max-width: 500px;
margin: auto;
border: none;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
text-shadow: 1px 1px 1px #444;
color: #D3D3D3;
background: #555;
}
.Content-Main h1{
padding: 8px 0px 40px 10px;
display: block;
border-bottom: 1px solid #444;
}
.text1{
margin-left: 3px;
}
.Content-Main label{
margin: 0px 0px 5px;
display: block;
}
.fileInputContainer{
height: 99px;
width: 99px;
margin: 20px 20px 20px 20px ;
border: none;
background: url("4.jpg");
overflow: hidden;
position: relative;
}
.fileInput{
height: 106px;
border: none;
font-size: 300px;
opacity: 0;
filter:alpha(opacity=0);
cursor: pointer;
position: absolute;
}
.Content-Main label>span{
width: 20%;
float: left;
text-align: right;
padding-right: 10px;
margin-top: 10px;
font-weight: bold;
}
.Main-sex{
padding-right: 13px;
padding-bottom: 13px;
font-weight: bold;
line-height: 4px;
}
.Main-sex input[type=checkbox]{
margin-top:6px;
vertical-align:middle;
}
.Content-Main input[type="text"],.Content-Main input[type="email"],.Content-Main textarea{
height: 25px;
width: 70%;
line-height: 15px;
padding: 5px 0px 5px 5px;
margin-bottom: 16px;
margin-right: 6px;
margin-top: 2px;
border: none;
border-radius:2px;
-webkit-border-radius:2px;
-moz-border-radius:2px;
outline: 0 none;
background: #DFDFDF;
color: #525252;
}
.Content-Main textarea{
height: 100px;
width: 70%;
padding: 5px 0px 0px 5px;
}
.Content-Main .button{
padding: 8px 24px 8px 24px;
margin-bottom: 8px;
border: none;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
font-weight: bold;
text-shadow: 1px 1px 1px #FFE477;
box-shadow: 1px 1px 1px #3D3D3D;
-moz-box-shadow: 1px 1px 1px #3D3D3D;
-webkit-box-shadow: 1px 1px 1px #3D3D3D;
color: #585858;
background: #f6ff0a;
}
.Content-Main .button:hover{
color: #333;
background-color: #EBEBEB ;
}
</style>
</head>
<body>
<body background="1.jpg"></body>
<div class="Content-Main">
<form action="/std" >
<h1>个人信息</h1>
<span class="text1">请在文本框中完善您的个人信息:</span>
<p>
<div class="fileInputContainer">
<input class="fileInput" id="" type="file" name="">
</div>
<label>
<span>Your name:</span>
<input type="text" name="finame" placeholder="Your Full Name">
</label>
<label class="Main-sex">
<span>Your sex:</span>
<input type="checkbox" class="man">
<input type="checkbox" class="women">
</label>
<label>
<span>Your email :</span>
<input type="email" name="email" placeholder="@.com">
</label>
<label>
<span>Your phone:</span>
<input type="text" name="phone" placeholder="Please input 11 number">
</label>
<input type="submit" value="提交" onclick="注册成功">
</form>
<form action="/std1" method="post">
<input type="submit" value="更改密码" onclick="注册成功">
</form>
<form action="/std3" method="post">
<input type="submit" value="注销该账号" onclick="注册成功">
</form>
</div>
</body>
</html>

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UserInfo</title>
<style type="text/css">
.Content-Main{
max-width: 500px;
margin: auto;
border: none;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
text-shadow: 1px 1px 1px #444;
color: #D3D3D3;
background: #555;
}
.Content-Main h1{
padding: 8px 0px 40px 10px;
display: block;
border-bottom: 1px solid #444;
}
.text1{
margin-left: 3px;
}
.Content-Main label{
margin: 0px 0px 5px;
display: block;
}
.fileInputContainer{
height: 99px;
width: 99px;
margin: 20px 20px 20px 20px ;
border: none;
background: url("4.jpg");
overflow: hidden;
position: relative;
}
.fileInput{
height: 106px;
border: none;
font-size: 300px;
opacity: 0;
filter:alpha(opacity=0);
cursor: pointer;
position: absolute;
}
.Content-Main label>span{
width: 20%;
float: left;
text-align: right;
padding-right: 10px;
margin-top: 10px;
font-weight: bold;
}
.Main-sex{
padding-right: 13px;
padding-bottom: 13px;
font-weight: bold;
line-height: 4px;
}
.Main-sex input[type=checkbox]{
margin-top:6px;
vertical-align:middle;
}
.Content-Main input[type="text"],.Content-Main input[type="email"],.Content-Main textarea{
height: 25px;
width: 70%;
line-height: 15px;
padding: 5px 0px 5px 5px;
margin-bottom: 16px;
margin-right: 6px;
margin-top: 2px;
border: none;
border-radius:2px;
-webkit-border-radius:2px;
-moz-border-radius:2px;
outline: 0 none;
background: #DFDFDF;
color: #525252;
}
.Content-Main textarea{
height: 100px;
width: 70%;
padding: 5px 0px 0px 5px;
}
.Content-Main .button{
padding: 8px 24px 8px 24px;
margin-bottom: 8px;
border: none;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
font-weight: bold;
text-shadow: 1px 1px 1px #FFE477;
box-shadow: 1px 1px 1px #3D3D3D;
-moz-box-shadow: 1px 1px 1px #3D3D3D;
-webkit-box-shadow: 1px 1px 1px #3D3D3D;
color: #585858;
background: #f6ff0a;
}
.Content-Main .button:hover{
color: #333;
background-color: #EBEBEB ;
}
</style>
</head>
<body>
<body background="1.jpg"></body>
<div class="Content-Main">
<form action="/std2" >
<h1>个人信息</h1>
<span class="text1">请在文本框中完善您的个人信息:</span>
<p>
<div class="fileInputContainer">
<input class="fileInput" id="" type="file" name="">
</div>
<label>
<span>你当前密码:</span>
<input type="password" name="pwd1" placeholder="pwd"><br><br>
</label>
<label>
<span>更改密码:</span>
<input type="password" name="pwd2" placeholder="updatepwd"><br><br>
</label>
<label>
<span>确认更改密码:</span>
<input type="password" name="pwd3" placeholder="confirm"><br><br>
</label>
<input type="submit" value="提交" onclick="注册成功">
</form>
</div>
</body>
</html>

@ -1,5 +0,0 @@
{
"crawl_id": 76,
"table_name": "god_crawl_result",
"type": "response"
}

@ -0,0 +1 @@
{"cookie":{"originalMaxAge":30000,"expires":"2022-07-06T01:21:08.727Z","httpOnly":true,"path":"/"},"user":"ybb","__lastAccess":1657070438728}

@ -0,0 +1 @@
{"cookie":{"originalMaxAge":30000,"expires":"2022-07-06T01:14:19.696Z","httpOnly":true,"path":"/"},"__lastAccess":1657070029697}

@ -0,0 +1 @@
{"cookie":{"originalMaxAge":30000,"expires":"2022-07-06T01:15:41.720Z","httpOnly":true,"path":"/"},"__lastAccess":1657070111721}

@ -0,0 +1 @@
{"cookie":{"originalMaxAge":30000,"expires":"2022-07-06T01:34:47.377Z","httpOnly":true,"path":"/"},"user":"ybb","__lastAccess":1657071257379}

@ -0,0 +1 @@
{"cookie":{"originalMaxAge":30000,"expires":"2022-07-06T01:59:16.846Z","httpOnly":true,"path":"/"},"__lastAccess":1657072726848}

@ -0,0 +1 @@
{"cookie":{"originalMaxAge":30000,"expires":"2022-07-06T01:25:40.091Z","httpOnly":true,"path":"/"},"__lastAccess":1657070710092}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save