lib/angelo/server.rb in angelo-0.1.13 vs lib/angelo/server.rb in angelo-0.1.14

- old
+ new

@@ -34,11 +34,11 @@ end private def dispatch! meth, connection, request - if staticable?(meth) and lp = local_path(request.path) + if staticable?(meth) and lp = @base.local_path(request.path) static! meth, connection, request, lp else route! meth, connection, request end end @@ -54,17 +54,10 @@ Angelo.log connection, request, nil, :not_found connection.respond :not_found, DEFAULT_RESPONSE_HEADERS, NOT_FOUND end end - def local_path path - if @base.public_dir - lp = File.join(@base.public_dir, path) - File.file?(lp) ? lp : nil - end - end - def staticable? meth STATICABLE.include? meth end def static! meth, connection, request, local_path @@ -77,14 +70,9 @@ # Content-Type # CONTENT_TYPE_HEADER_KEY => (MIME::Types.type_for(File.extname(local_path))[0].content_type rescue HTML_TYPE), - - # Content-Disposition - # - CONTENT_DISPOSITION_HEADER_KEY => - DEFAULT_CONTENT_DISPOSITION + "; filename=#{File.basename local_path}", # Content-Length # CONTENT_LENGTH_HEADER_KEY => File.size(local_path),