diff --git a/lib/jekyll/commands/serve.rb b/lib/jekyll/commands/serve.rb index a12096ae..ae28665b 100644 --- a/lib/jekyll/commands/serve.rb +++ b/lib/jekyll/commands/serve.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- module Jekyll module Commands class Serve < Command @@ -12,13 +13,17 @@ module Jekyll mime_types_file = File.expand_path('../mime.types', File.dirname(__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( :Port => options['port'], :BindAddress => options['host'], :MimeTypes => mime_types ) - s.mount(options['baseurl'], HTTPServlet::FileHandler, destination) + s.mount(options['baseurl'], HTTPServlet::FileHandler, destination, fh_option) t = Thread.new { s.start } trap("INT") { s.shutdown } t.join()