Skip to content

Commit

Permalink
Update http-cookie-agent to version 5
Browse files Browse the repository at this point in the history
Minor code changes necessary, but otherwise it seems to work well
enough. Part of #25.
  • Loading branch information
lucaswerkmeister committed Jun 10, 2023
1 parent 3d4e86c commit 1b0c688
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions axios.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import { HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent';
import { HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent/http';
import { CookieJar } from 'tough-cookie';
import { Session } from './core.js';

Expand All @@ -19,7 +19,7 @@ class AxiosSession extends Session {
constructor( apiUrl, defaultParams = {}, defaultOptions = {} ) {
super( apiUrl, defaultParams, defaultOptions );
const agentOptions = {
jar: new CookieJar(),
cookies: { jar: new CookieJar() },
keepAlive: true,
};
this.session = axios.create( {
Expand Down
31 changes: 22 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"axios": "^1.3.5",
"http-cookie-agent": "^1.0.6",
"http-cookie-agent": "^5.0.2",
"tough-cookie": "^4.1.2"
},
"devDependencies": {
Expand Down

0 comments on commit 1b0c688

Please sign in to comment.