• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

ギコナビ


Commit MetaInfo

Revisão950df316ca5f5a4214f6bfa07a0a532040d6b322 (tree)
Hora2010-07-10 16:52:22
Autorh677 <h677>
Commiterh677

Mensagem de Log

2ちゃんねるビューアへのログインで、リクエストヘッダを追加

Mudança Sumário

Diff

--- a/Dolib.pas
+++ b/Dolib.pas
@@ -33,7 +33,7 @@ unit Dolib;
3333 interface
3434
3535 uses
36- Windows, SysUtils, WinInet;
36+ Windows, SysUtils, WinInet, YofUtils;
3737
3838 type
3939 TDolibSession = class(TObject)
@@ -227,6 +227,7 @@ var
227227 Buf: array[0..4096] of Char;
228228 UserInfo: string;
229229 UserAgent: string;
230+ Header: string;
230231 cb: DWORD;
231232 Delim: Integer;
232233 begin
@@ -255,9 +256,11 @@ begin
255256 if not Assigned(hRequest) then
256257 MakeError(FSession, GetLastError())
257258 else begin
258- UserInfo := Format('ID=%s&PW=%s', [ID, Pass]);
259+ UserInfo := Format('ID=%s&PW=%s', [HttpEncode(ID), HttpEncode(Pass)]);
260+ Header := 'Content-Type: application/x-www-form-urlencoded'#13#10;
259261 UserAgent := Format('%s %s', [DOLIB_2CH_UA, ClientUA]) + #13#10;
260- if not HttpSendRequest(hRequest, PChar(UserAgent), DWORD(-1), PChar(UserInfo), Length(UserInfo)) then
262+ Header := Header + UserAgent;
263+ if not HttpSendRequest(hRequest, PChar(Header), DWORD(-1), PChar(UserInfo), Length(UserInfo)) then
261264 MakeError(FSession, GetLastError())
262265 else begin
263266 if not InternetReadFile(hRequest, @Buf, SizeOf(Buf), cb) then
Binary files a/gikoNavi.res and b/gikoNavi.res differ