Skip to content
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

解决多次调用SetCookies会导致cookies越来越长的问题 #69

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

CuteReimu
Copy link
Owner

@CuteReimu CuteReimu commented Jul 4, 2024

@yanyao2333 @RunsTp

我简单改了一版。

因为Go1.19标准库里没有slices包,就自己写循环了。


至于是否需要提供一个删除所有Cookies的函数,先不提供吧,如果真的需要也可以自行c.Resty().Cookies = nil来解决。

这让我想起了好笑的事情:

bilibili/README.md

Lines 231 to 233 in 7f31348

### 设置*resty.Client的一些参数
调用`client.Resty()`就可以获取到`*resty.Client`,然后自行操作即可。**但是不要做一些离谱的操作**~~(比如把Cookies删了)~~

但是不要做一些离谱的操作(比如把Cookies删了)

@CuteReimu CuteReimu added the question Further information is requested label Jul 4, 2024
@CuteReimu CuteReimu linked an issue Jul 4, 2024 that may be closed by this pull request
@CuteReimu CuteReimu changed the title 解决多次调用SetCookies会导致cookies越来越长的问题(fix #68) 解决多次调用SetCookies会导致cookies越来越长的问题 Jul 4, 2024
Copy link
Collaborator

@RunsTp RunsTp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考虑到cookies并不会很长,我认为没有问题

@CuteReimu CuteReimu merged commit 18c0f34 into master Jul 4, 2024
2 checks passed
@CuteReimu CuteReimu deleted the fix-SetCookies branch July 4, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

多次调用SetCookiesString,原先client内的cookies不会被覆盖
2 participants