Skip to content

Commit

Permalink
Monakey読み込み時のチェック追加
Browse files Browse the repository at this point in the history
  • Loading branch information
onihusube committed Apr 24, 2022
1 parent 2e49b6b commit 8629729
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
4 changes: 3 additions & 1 deletion 2chAPIProxy/DatProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,8 @@ private void ResPostv2(Session oSession, bool is2ch)
false => Encoding.GetEncoding("Shift_JIS")
};

//ReqBody += "&sid=Monazilla/2.00:08urgq8vn478951437vn89574389v7843y584vht";

// リクエストボディの分解(URLデコードもしておく)
var post_field_map = ReqBody.Split('&')
.Select(kvpair => kvpair.Split('='))
Expand Down Expand Up @@ -1184,7 +1186,7 @@ private void ResPostv2(Session oSession, bool is2ch)
if (m.Success)
{
// クッキーにある場合(一般ブラウザ、sikiなど?)
// クッキーはsid=xxxxの形で保存されてる
// クッキーはsid=xxxxの形で保存されてる(はず
Write.Headers.Add("X-Ronin-Sid", m.Value);
}
}
Expand Down
2 changes: 1 addition & 1 deletion 2chAPIProxy/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:_2chAPIProxy" mc:Ignorable="d" x:Class="_2chAPIProxy.MainWindow"
Title="2chAPIProxy Ver:2022.04.12 test" Height="480" Width="640"
Title="2chAPIProxy Ver:2022.04.25 test" Height="480" Width="640"
Icon="icon3.ico" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" Background="White" d:DataContext="{d:DesignInstance {x:Type local:ViewModel}}">
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+S" Command="{Binding SaveSetting}"/>
Expand Down
1 change: 1 addition & 0 deletions 2chAPIProxy/ViewModels/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public void Init()
DatProxy.AddMsToNonce = AddMsToNonce;
DatProxy.AssumeReqBodyIsUTF8 = AssumeReqBodyIsUTF8;
DatProxy.Monakey = Setting.Monakey;
if (string.IsNullOrEmpty(Setting.Monakey)) DatProxy.ResetMonakey();

//設定の適用、APIアクセスクラス
DatProxy.APIMediator.AppKey = this.Appkey;
Expand Down
51 changes: 51 additions & 0 deletions doc/書き込み新仕様関連.md
Original file line number Diff line number Diff line change
Expand Up @@ -1112,4 +1112,55 @@ Content-Encoding:
Content-Type:text/html; charset=Shift_JIS
Date:Sun, 10 Apr 2022 17:24:14 GMT
Server:cloudflare
```

# X-Ronin-Sidに適当な値を入れて送ったとき


```
オリジナルリクエストヘッダ
Host:egg.5ch.net
User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language:ja,en-US;q=0.7,en;q=0.3
Accept-Encoding:gzip, deflate
Referer:http://egg.5ch.net/test/read.cgi/software/1650247139/
Upgrade-Insecure-Requests:1
Content-Type:application/x-www-form-urlencoded
Content-Length:140
Connection:keep-alive
リクエストヘッダ
Referer:https://egg.5ch.net/test/read.cgi/software/1650247139/
X-PostSig:fbaaf4d2fe631152d34030a9253862e669768f6365ad933f43851e42242b961e
X-APIKey:8yoeAcaLXiEY1FjEuJBKgkPxirkDqn
X-PostNonce:1650792234.765
X-MonaKey:b1fd22457df0fc0d096dbeb719f15a006449599cb5d181e0d90bdc382c91f964
X-2ch-UA:2chMate/0.8.10.153
X-Ronin-Sid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent:Monazilla/1.00 2chMate/0.8.10.153 Dalvik/2.1.0 (Linux; U; Android 11; SC-52B Build/RP1A.200720.012; 60)
Accept-Encoding:gzip
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Host:egg.5ch.net
Content-Length:148
Connection:Keep-Alive
レスポンスヘッダ
Connection:close
X-InqID:egg/700dcc7c3d368344;
X-Robots-Tag:noindex;
X-Chx-Error:6200 Invalid RONIN SID;
X-PostPlace:software/1650247139
X-RONIN-Stat:NONE
X-Condition:0/0
X-Proc-Time:0.124839 sec.
X-BBx-Stat:180.60.38.129, NONE
Vary:Accept-Encoding
CF-Cache-Status:DYNAMIC
Expect-CT:max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
CF-RAY:700dcc7c3d368344-KIX
Content-Encoding:
Content-Type:text/html; charset=Shift_JIS
Date:Sun, 24 Apr 2022 09:26:42 GMT
Server:cloudflare
```

0 comments on commit 8629729

Please sign in to comment.