Patch for multibyte URI problem. Closes #723.

This commit is contained in:
paco 2013-03-16 21:20:04 +01:00 committed by Parker Moore
parent df7b9f4f01
commit 23a01e7766
1 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
module Jekyll module Jekyll
module Commands module Commands
class Serve < Command class Serve < Command
@ -12,13 +13,17 @@ module Jekyll
mime_types_file = File.expand_path('../mime.types', File.dirname(__FILE__)) mime_types_file = File.expand_path('../mime.types', File.dirname(__FILE__))
mime_types = WEBrick::HTTPUtils::load_mime_types(mime_types_file) mime_types = WEBrick::HTTPUtils::load_mime_types(mime_types_file)
# recreate NondisclosureName under utf-8 circumstance
fh_option = WEBrick::Config::FileHandler
fh_option[:NondisclosureName] = ['.ht*','~*']
s = HTTPServer.new( s = HTTPServer.new(
:Port => options['port'], :Port => options['port'],
:BindAddress => options['host'], :BindAddress => options['host'],
:MimeTypes => mime_types :MimeTypes => mime_types
) )
s.mount(options['baseurl'], HTTPServlet::FileHandler, destination) s.mount(options['baseurl'], HTTPServlet::FileHandler, destination, fh_option)
t = Thread.new { s.start } t = Thread.new { s.start }
trap("INT") { s.shutdown } trap("INT") { s.shutdown }
t.join() t.join()