JDimproved / JDim

2ch browser for linux
https://jdimproved.github.io/JDim/
GNU General Public License v2.0
44 stars 11 forks source link

SimpleCookieManager: Update Cookie management to remove expired Cookies #1381

Closed ma8ma closed 2 months ago

ma8ma commented 2 months ago

SimpleCookieManager: Update Cookie management to remove expired Cookies

Cookie管理機能を更新して有効期限が切れたCookieを削除します。

背景事情

5ch.netでは新しくドングリシステムが導入され、HTTPリクエストに含まれるCookieの識別子が一定期間で変更されるようになりました。 この変更時にCookieの有効期限が切れるため期限が切れたCookieを使ってレスを書き込むとエラーが発生します。 この修正では書き込みエラーを回避するために受信したCookieから有効期限を解析し、期限切れのCookieについては名前と値の組を削除するように変更します。

Background

5ch.net has introduced a new acorn system, whereby the cookie identifier in the HTTP request is changed after a certain period of time. When this change occurs, the cookie expires, so writing a response using an expired cookie will result in an error. To avoid writing errors, this fix parses the expiration date from the received cookie and removes the name/value pairs for expired cookies.

Add test cases for CookieManager::feed() parsing expires

関連のissue: #1376