Changeset 225

Show
Ignore:
Timestamp:
04/30/07 15:04:05 (2 years ago)
Author:
e.@brainspl.at
Message:

fixed shared repsonse headers problem. w00t. thanks to Bob, kastner and vox ajax file uploads work again.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Rakefile

    r208 r225  
    1616 
    1717NAME = "merb" 
    18 VERS = "0.3.0
     18VERS = "0.3.1
    1919CLEAN.include ['**/.*.sw?', '*.gem', '.config'] 
    2020 
  • trunk/lib/merb.rb

    r224 r225  
    11require 'rubygems' 
    2 require 'mongrel' 
     2if ENV['SWIFT'] 
     3 require 'swiftcore/swiftiplied_mongrel' 
     4 puts "Using Swiftiplied Mongrel" 
     5elsif ENV['EVENT'] 
     6  require 'swiftcore/evented_mongrel'  
     7  puts "Using Evented Mongrel" 
     8else 
     9 require 'mongrel' 
     10end 
    311require 'fileutils' 
    412require 'erubis' 
     
    1321 
    1422module Merb 
    15   VERSION='0.3.0' unless defined?VERSION 
     23  VERSION='0.3.1' unless defined?VERSION 
    1624  class Server 
    1725    class << self 
     
    7381  HTTP_COOKIE   =  'HTTP_COOKIE'.freeze 
    7482  QUERY_STRING  =  'QUERY_STRING'.freeze 
    75   CONTENT_TYPE_TEXT_HTML_HASH = {'Content-Type' =>'text/html'} 
    7683  APPLICATION_JSON = 'application/json'.freeze  
    7784  TEXT_JSON        = 'text/x-json'.freeze 
  • trunk/lib/merb/core_ext/merb_object.rb

    r224 r225  
    77   
    88  def meta_class() class << self; self end end 
     9   
    910  def meta_eval(&blk) meta_class.instance_eval( &blk ) end 
     11   
    1012  def meta_def(name, &blk) meta_eval { define_method name, &blk } end 
     13   
    1114  def class_def name, &blk 
    1215    self.class.class_eval { define_method name, &blk } 
  • trunk/lib/merb/merb_controller.rb

    r224 r225  
    4040      @env = MerbHash[env.to_hash] 
    4141      @status, @method, @response, @headers = 200, (env[Mongrel::Const::REQUEST_METHOD]||Mongrel::Const::GET).downcase.to_sym, response, 
    42           Mongrel::Const::CONTENT_TYPE_TEXT_HTML_HASH 
     42         {'Content-Type' =>'text/html'} 
    4343      cookies = query_parse(@env[Mongrel::Const::HTTP_COOKIE], ';,') 
    4444      querystring = query_parse(@env[Mongrel::Const::QUERY_STRING]) 
  • trunk/lib/merb/merb_dispatcher.rb

    r223 r225  
    1212      @@mutex = Mutex.new 
    1313      @@use_mutex = ::Merb::Server.use_mutex 
    14       # This is where we grab the incoming request PATH_INFO 
     14      # This is where we grab the incoming request REQUEST_URI 
    1515      # and use that in the merb routematcher to determine 
    1616      # which controller and method to run.  
  • trunk/lib/merb/merb_upload_handler.rb

    r170 r225  
    66  end 
    77   
    8   HttpHandler.class_eval do 
    9     def request_aborted(params) 
    10     end 
    11   end 
    12    
    13   HttpRequest.class_eval do 
    14     def initialize_with_abort(params, socket, dispatchers) 
    15       initialize_without_abort(params, socket, dispatchers) 
    16       dispatchers.each {|d| d.request_aborted(params) if @body.nil? && d } 
     8  unless ENV['EVENT'] || ENV['SWIFT'] 
     9    HttpHandler.class_eval do 
     10      def request_aborted(params) 
     11      end 
    1712    end 
    1813     
    19     alias_method :initialize_without_abort, :initialize 
    20     alias_method :initialize, :initialize_with_abort 
     14    HttpRequest.class_eval do 
     15      def initialize_with_abort(params, socket, dispatchers) 
     16        initialize_without_abort(params, socket, dispatchers) 
     17        dispatchers.each {|d| d.request_aborted(params) if @body.nil? && d } 
     18      end 
     19       
     20      alias_method :initialize_without_abort, :initialize 
     21      alias_method :initialize, :initialize_with_abort 
     22    end 
    2123  end 
    2224end 
  • trunk/lib/merb/template/haml.rb

    r224 r225  
    3333        @@hamls ||= {} 
    3434        @@mtimes ||= {} 
     35         
    3536        def exempt_from_layout? 
    3637          false