ToDo:
weather pluginの不具合の件だが、直した!
Index: misc/plugin/weather.rb
===================================================================
--- misc/plugin/weather.rb (.../vender/tDiary.org/tdiary-core/stable/misc/plugin/weather.rb) (revision 759)
+++ misc/plugin/weather.rb (.../trunk/public:amorita/diary/misc/plugin/weather.rb) (revision 759)
@@ -64,7 +64,7 @@
- first draft
=end
-require 'net/http'
+require 'net/https'
require 'cgi'
require 'timeout'
require 'date' # DateTime.strptime
@@ -154,7 +154,7 @@
AVIATIONWEATHER_STATION_REGEXP = %r|(?:aviationweather.gov/adds/metars/\?.*station_ids=)([A-Z]{4,4})\b|
NOAA_STATION_REGEXP = %r|(?:weather.noaa.gov/weather/current/)([A-Z]{4,4})\b|
RAW_STATION_REGEXP = %r|\A([A-Z]{4,4})\z|
- STATION_URL_TEMPLATE = "http://www.aviationweather.gov/adds/metars/?station_ids=%s&std_trans=translated&chk_metars=on&hoursStr=most+recent+only"
+ STATION_URL_TEMPLATE = "https://www.aviationweather.gov/adds/metars/?station_ids=%s&std_trans=translated&chk_metars=on&hoursStr=most+recent+only"
def Weather::extract_station_id(url)
[AVIATIONWEATHER_STATION_REGEXP, NOAA_STATION_REGEXP, RAW_STATION_REGEXP].each do |r|
@@ -292,12 +292,14 @@
px_host, px_port = (@conf['proxy'] || '').split( /:/ )
px_port = 80 if px_host and !px_port
u = URI::parse( url )
- Net::HTTP::Proxy( px_host, px_port ).start( u.host, u.port ) do |http|
+ session = Net::HTTP::Proxy( px_host, px_port ).new( u.host, u.port )
+ session.use_ssl = u.scheme == "https"
+ session.start do |http|
case res = http.get( u.request_uri, header )
when Net::HTTPSuccess
res.body
when Net::HTTPRedirection
- fetch( res['location'], limit - 1 )
+ fetch( res['location'], limit - 1, header )
else
raise ArgumentError, res.error!
end
カテゴリー: Admin | Emacs | EPICS | Fortran | FreeBSD | GCC | hgsubversion | IPv6 | KEKB | LHC | Lisp | LLVM | MADX | Ryzen | SAD | samba | tDiary | unix | WWW | YaSAI | お仕事 | イベント | 出張 | 宴会 | 数学 | 艦これ | 買いもの | 追記 | 雑記