public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
uhhhhhhhh...
wycats (author)
Tue Jun 10 17:00:27 -0700 2008
commit  0e36b591f46eaecdba168f03b36b87388eb5cfa3
tree    90fc8765e50963e7ac4d7d0c6e8064b30a16fe5c
parent  e8c05531659c45f918f17b7627886bf3e9a40556
...
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
 
354
355
356
...
323
324
325
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
327
328
329
0
@@ -323,34 +323,7 @@ module Merb::RenderMixin
0
   # Hash:: The options hash that was passed in.
0
   def _handle_options!(opts)
0
     self.status = opts[:status].to_i if opts[:status]
0
-    _handle_location!(opts)
0
-    opts
0
-  end
0
-
0
-  # Handle the :location option appropriately
0
-  #
0
-  # ==== Parameters
0
-  # opts<Hash>:: The options hash that was passed to the render
0
-  #
0
-  # ==== Options
0
-  # :location
0
-  #    Sets headers['Location'] to the provided URL
0
-  #
0
-  # ==== Returns
0
-  # Hash:: The options hash that was passed in.
0
-  def _handle_location!(opts)
0
-    if header_location = opts.delete(:location)
0
-      # scope it
0
-      use_header_url = nil
0
-      if header_location.is_a? String
0
-        # Hope they know what they're doing
0
-        use_header_url = header_location
0
-      # Removed magic url :klass, @obj detection. Reconsider adding it?
0
-      end
0
-      # If we couldn't figure anything out, best let the user know
0
-      raise "Unable to determine `:location' given #{header_location.inspect}" if use_header_url.nil?
0
-      headers['Location'] = use_header_url
0
-    end
0
+    headers["Location"] = opts.delete(:location) if opts[:location]
0
     opts
0
   end
0
 

Comments