summary refs log tree commit
path: root/lib/rack/file.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-26 11:10:40 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-26 11:10:40 -0600
commitbf10d313b125e7fde1acaab1fe6492dc32c9a25f (patch)
treef2ac232d02569c78de65cdd3d906092b015217b5 /lib/rack/file.rb
parentfaafcea111bbe60733f5ba6a16539ac0bffb6d40 (diff)
downloadrack-bf10d313b125e7fde1acaab1fe6492dc32c9a25f.tar.gz
Tag not found responses from file servers with X-Cascade header
Prepares internal file servers for revised Rack::Cascade that looks
for a magic header instead of discarding all 404 responses.
Diffstat (limited to 'lib/rack/file.rb')
-rw-r--r--lib/rack/file.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rack/file.rb b/lib/rack/file.rb
index fe62bd6b..14af7b3b 100644
--- a/lib/rack/file.rb
+++ b/lib/rack/file.rb
@@ -45,7 +45,8 @@ module Rack
     def forbidden
       body = "Forbidden\n"
       [403, {"Content-Type" => "text/plain",
-             "Content-Length" => body.size.to_s},
+             "Content-Length" => body.size.to_s,
+             "X-Cascade" => "pass"},
        [body]]
     end
 
@@ -73,7 +74,8 @@ module Rack
     def not_found
       body = "File not found: #{@path_info}\n"
       [404, {"Content-Type" => "text/plain",
-         "Content-Length" => body.size.to_s},
+         "Content-Length" => body.size.to_s,
+         "X-Cascade" => "pass"},
        [body]]
     end