kirinlabs / HttpRequest

Simplified HTTP client, A simplie golang HTTP client library.
Apache License 2.0
176 stars 50 forks source link

the header #9

Closed tobycroft closed 4 years ago

tobycroft commented 4 years ago

---------newversion of 1.0.5-------------- ret.Cookies() will return [sid=ax4f9ahs; Path=/; Domain=bilibili.com; Expires=Tue, 30 Mar 2021 12:19:57 GMT JSESSIONID=8554FE9AE225A28EE602EB242039F185; Path=/; HttpOnly]

ret.Headers(): map[Cache-Control:[no-cache] Connection:[keep-alive] Content-Type:[image/jpeg;charset=UTF-8] Date:[Mon, 30 Mar 2020 12:21:01 GMT] Expires:[Mon, 30 Mar 2020 12:21:00 GMT] Server:[Apache-Coyote/1.1] Set-Cookie:[sid=cwoxpg5s; Domain=.bilibili.com; Expires=Tue, 30-Mar-2021 12:21:01 GMT; Path=/ JSESSIONID=20DB73A6ACD745E4EC0E40220623A49D; Path=/; HttpOnly] X-Cache-Webcdn:[BYPASS from hw-sh3-webcdn-11]]

---------old ver 0.1.6----------- map[Cache-Control:no-cache Connection:keep-alive Content-Type:image/jpeg;charset=UTF-8 Date:Mon, 30 Mar 2020 12:22:08 GMT Expires:Mon, 30 Mar 2020 12:22:07 GMT Server:Apache-Coyote/1.1 Set-Cookie:JSESSIONID=415B8AB4C9E7D4759FBC05D0B0B45C15; Path=/; HttpOnly X-Cache-Webcdn:BYPASS from hw-sh3-webcdn-11]

look at the "JSESSIONID"

I am using strings.splits to split the ";"

but in the new version JSESSIONID was on the strange place that I can't get it out of the common string

I ve noidea with this new version could you keep the old Header infomation instead of replace them all?