Skip to content

Commit d8bab9b

Browse files
authored
Merge pull request #171 from lifeomic/axios-0.28
feat: axios 0.28.0
2 parents b9003c1 + 80e2aef commit d8bab9b

File tree

6 files changed

+25
-18
lines changed

6 files changed

+25
-18
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- 'master'
7+
- 'alpha'
78

89
jobs:
910
build:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"@aws-sdk/signature-v4": "^3.110.0",
6161
"@aws-sdk/url-parser": "^3.357.0",
6262
"@types/aws-lambda": "^8.10.101",
63-
"axios": "^0.27.2",
63+
"axios": "^0.28.0",
6464
"lodash": "^4.17.21",
6565
"nearley": "2",
6666
"url-parse": "^1.5.10",

release.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
branches: ['master'],
2+
branches: ['master', { name: 'alpha', prerelease: true }],
33
plugins: [
44
['@semantic-release/commit-analyzer', { preset: 'conventionalcommits' }],
55
'@semantic-release/npm',

src/alpha.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ export class Alpha extends Axios {
7575
if (castResp.status === 301 || castResp.status === 302) {
7676
if (maxRedirects === 0) {
7777
const request = castResp.request as InvocationRequest | HandlerRequest;
78-
throw new RequestError('Exceeded maximum number of redirects.', castResp.config, request, response);
78+
throw new RequestError('Exceeded maximum number of redirects.', castResp.config, request, castResp);
7979
}
8080

8181
const redirect = cloneDeep(config);
8282
redirect.maxRedirects = maxRedirects - 1;
83-
redirect.url = resolve(castResp.headers.location, castResp.config.url as string);
83+
redirect.url = resolve(castResp.headers.location as string, castResp.config.url as string);
8484
return this.request(redirect);
8585
}
8686

test/lambda-invocation.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,19 +482,19 @@ test('A configured timeout does not hinder normal lambda function invocation beh
482482
});
483483

484484
test('A configured timeout does not eat lambda function invocation errors', async () => {
485-
jest.useFakeTimers();
485+
jest.useFakeTimers({ doNotFake: ['performance'] });
486486
jest.spyOn(global, 'setTimeout');
487487
jest.spyOn(global, 'clearTimeout');
488488
delayedLambda(1, new Error('Other error'));
489489
const promise = ctx.alpha.get('/some/path', {
490490
Lambda: FakeLambda,
491491
timeout: 1000,
492-
} as any as AxiosRequestConfig);
492+
});
493493
await expect(promise).rejects.toThrow('Other error');
494-
expect(ctx.abort).not.toBeCalled();
494+
expect(ctx.abort).not.toHaveBeenCalled();
495495

496-
expect(setTimeout).toBeCalledTimes(1);
497-
expect(clearTimeout).toBeCalledTimes(1);
496+
expect(setTimeout).toHaveBeenCalledTimes(1);
497+
expect(clearTimeout).toHaveBeenCalledTimes(1);
498498
});
499499

500500
test('lambda function invocation errors are re-thrown', async () => {

yarn.lock

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,13 +2427,14 @@ aws4@^1.8.0:
24272427
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
24282428
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
24292429

2430-
axios@^0.27.2:
2431-
version "0.27.2"
2432-
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
2433-
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
2430+
axios@^0.28.0:
2431+
version "0.28.0"
2432+
resolved "https://registry.yarnpkg.com/axios/-/axios-0.28.0.tgz#801a4d991d0404961bccef46800e1170f8278c89"
2433+
integrity sha512-Tu7NYoGY4Yoc7I+Npf9HhUMtEEpV7ZiLH9yndTCoNhcpBH0kwcvFbzYN9/u5QKI5A6uefjsNNWaz5olJVYS62Q==
24342434
dependencies:
2435-
follow-redirects "^1.14.9"
2435+
follow-redirects "^1.15.0"
24362436
form-data "^4.0.0"
2437+
proxy-from-env "^1.1.0"
24372438

24382439
babel-jest@^28.1.2:
24392440
version "28.1.2"
@@ -3534,10 +3535,10 @@ flatted@^3.1.0:
35343535
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469"
35353536
integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==
35363537

3537-
follow-redirects@^1.14.9:
3538-
version "1.15.1"
3539-
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
3540-
integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==
3538+
follow-redirects@^1.15.0:
3539+
version "1.15.5"
3540+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020"
3541+
integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==
35413542

35423543
forever-agent@~0.6.1:
35433544
version "0.6.1"
@@ -5820,6 +5821,11 @@ propagate@^2.0.0:
58205821
resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45"
58215822
integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==
58225823

5824+
proxy-from-env@^1.1.0:
5825+
version "1.1.0"
5826+
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
5827+
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
5828+
58235829
psl@^1.1.28:
58245830
version "1.8.0"
58255831
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"

0 commit comments

Comments
 (0)