Skip to content

Commit

Permalink
Board2ch::update_hap(): Fix cookie retrieval method (JDimproved#1383)
Browse files Browse the repository at this point in the history
about:configの「2chのクッキーを保存する」を"はい"にしたときに行われる
2ch.net(5ch.net)のクッキーを更新する処理を修正します。

背景事情
`Board2ch::update_hap()`では`Board2chCompati::cookie_for_request()`を
使ってクッキーを取得していましたがこの関数は5ch.net以外のサイトに
アクセスする際に使うプロキシ設定に依存するため適切なクッキーが
取得できない可能性があります。
この修正では、プロキシ設定に依存しない`cookie_by_host()`関数を
使うように変更します。

Background
Previously, `Board2ch::update_hap()` method has used
`Board2chCompati::cookie_for_request()` to retrieve cookies, but this
function might not retrieve the correct cookie to depend proxy
settings for accessing sites other than 5ch.net.
This commit changes to use the `cookie_by_host()` function, which does
not depend on proxy settings. This ensures that the appropriate cookie
is always retrieved.
  • Loading branch information
ma8ma committed Apr 13, 2024
1 parent 150fd07 commit 3a096d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dbtree/board2ch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void Board2ch::update_hap()
{
if( ! CONFIG::get_use_cookie_hap() ) return;

const std::string new_cookie = Board2chCompati::cookie_for_request();
const std::string new_cookie = cookie_by_host();

if( ! new_cookie.empty() ) {
#ifdef _DEBUG
Expand Down

0 comments on commit 3a096d1

Please sign in to comment.