File tree 2 files changed +7
-0
lines changed
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -534,6 +534,10 @@ def self.get_setting_tab_info
534
534
"エラーは出ないが読めなくなる)" ,
535
535
tab : :detail
536
536
} ,
537
+ "user-agent" => {
538
+ type : :string , help : "User-Agent 設定\n 未指定時 Mozilla/5.0 (Windows NT 10.0; Win64; x64)" ,
539
+ tab : :detail
540
+ } ,
537
541
"webui.theme" => {
538
542
type : :select , help : "WEB UI 用テーマ選択" ,
539
543
invisible : true ,
Original file line number Diff line number Diff line change 6
6
7
7
require "open-uri"
8
8
require "openssl"
9
+ require_relative "inventory"
9
10
10
11
# open-uri で http → https へのリダイレクトを有効にする
11
12
require "open_uri_redirections"
12
13
13
14
# open-uri に渡すオプションを生成(必要に応じて extensions/*.rb でオーバーライドする)
14
15
def make_open_uri_options ( add )
16
+ ua = Inventory . load ( "local_setting" ) [ "user-agent" ] || "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
15
17
add . merge ( ssl_verify_mode : OpenSSL ::SSL ::VERIFY_NONE )
18
+ add . merge ( "User-Agent" => ua )
16
19
end
17
20
18
21
#
You can’t perform that action at this time.
0 commit comments