New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace tough-cookie #882
Comments
Out of curiosity, what other cookie storage would you use? |
You haven't opened such issue. Not to mention that |
I think @Rokt33r is referring to salesforce/tough-cookie#130 |
Ah. In this case I would just open a new PR. The fix is very simple. |
You just need to pass an object having these and you're good to go:
got/source/request-as-event-emitter.ts Lines 49 to 50 in f59a563
|
@sindresorhus I'm not using any for now. But if @szmarczak I think we need to define cookieJar interface in this package too. Otherwise, I still need to install @types/tough-cookie every time. Also it would be awesome if the new interface's methods return Promise rather than accepting callback although it should be breaking change... |
I agree. Maybe we'll see these promises in Got v11. Let's stay with the callbacks for now. |
@szmarczak It would be nice not to be so tied to |
interface CookieJar {
getCookieString(url: string, callback: (error: Error, cookieHeader: string) => void);
setCookie(rawCookie: string, url: string, callback: (error: Error, result: unknown) => void);
} we just need to detect if it's a Promise or is it a callback-style function :) |
What problem are you trying to solve?
I'm back from here. #811
It is an issue of tough-cookie library. But the fix is in stale status for several months...
Describe the feature
So I'm thinking it would be really nice if
got
provides an abstract interface so I can use other cookie store than tough-cookie.Checklist
The text was updated successfully, but these errors were encountered: