mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-04 21:39:04 +00:00
fix: replace upload fixture image.png with a smaller upload.txt (#563)
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -74,7 +74,7 @@ function doProxyWebSocket(url, headers = {}) {
|
|||||||
|
|
||||||
it('POST body and header', async () => {
|
it('POST body and header', async () => {
|
||||||
const url = `${protocol}://httpbin.org/post`;
|
const url = `${protocol}://httpbin.org/post`;
|
||||||
const payloadStream = fs.createReadStream(path.resolve(__dirname, './fixtures/image.png'));
|
const payloadStream = fs.createReadStream(path.resolve(__dirname, './fixtures/upload.txt'));
|
||||||
|
|
||||||
const postHeaders = {
|
const postHeaders = {
|
||||||
anyproxy_header: 'header_value',
|
anyproxy_header: 'header_value',
|
||||||
@@ -86,7 +86,7 @@ function doProxyWebSocket(url, headers = {}) {
|
|||||||
|
|
||||||
it('PUT', async () => {
|
it('PUT', async () => {
|
||||||
const url = `${protocol}://httpbin.org/put`;
|
const url = `${protocol}://httpbin.org/put`;
|
||||||
const payloadStream = fs.createReadStream(path.resolve(__dirname, './fixtures/image.png'));
|
const payloadStream = fs.createReadStream(path.resolve(__dirname, './fixtures/upload.txt'));
|
||||||
await basicProxyRequest(proxyHost, 'PUT', url, {}, undefined, payloadStream).then(assertProxyRes);
|
await basicProxyRequest(proxyHost, 'PUT', url, {}, undefined, payloadStream).then(assertProxyRes);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
BIN
test/fixtures/image.png
vendored
BIN
test/fixtures/image.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB |
1
test/fixtures/upload.txt
vendored
Normal file
1
test/fixtures/upload.txt
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
@@ -34,7 +34,7 @@ describe('Rule beforeDealHttpsRequest', () => {
|
|||||||
});
|
});
|
||||||
it('Should replace the https request body', async () => {
|
it('Should replace the https request body', async () => {
|
||||||
const url = 'https://httpbin.org/put';
|
const url = 'https://httpbin.org/put';
|
||||||
const payloadStream = fs.createReadStream(path.resolve(__dirname, '../fixtures/image.png'));
|
const payloadStream = fs.createReadStream(path.resolve(__dirname, '../fixtures/upload.txt'));
|
||||||
const postHeaders = {
|
const postHeaders = {
|
||||||
anyproxy_header: 'header_value',
|
anyproxy_header: 'header_value',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ describe('Rule replaceRequestData', () => {
|
|||||||
|
|
||||||
it('should replace the request data in proxy if the assertion is true', async () => {
|
it('should replace the request data in proxy if the assertion is true', async () => {
|
||||||
const url = 'http://httpbin.org/post';
|
const url = 'http://httpbin.org/post';
|
||||||
const payloadStream = fs.createReadStream(path.resolve(__dirname, '../fixtures/image.png'));
|
const payloadStream = fs.createReadStream(path.resolve(__dirname, '../fixtures/upload.txt'));
|
||||||
const postHeaders = {
|
const postHeaders = {
|
||||||
anyproxy_header: 'header_value',
|
anyproxy_header: 'header_value',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user