Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2012-04-20 08:07:30 (GMT)
committer Christian Johansen <christian@gitorious.com>2013-01-08 14:03:00 (GMT)
commit8f78bbfe707e18ac1d9c190ec7a06af744fafc76 (patch)
tree39499c41187dbd7395d1f86ac2cfee59669e0a84
parent110edd6018d49211603934261736183b8e4b8b24 (diff)
Do not use Content-Disposition: attachment for raw blobs
This should make it possible to view documents directly via the Gitorious web interface.
-rw-r--r--app/controllers/blobs_controller.rb2
-rw-r--r--test/functional/blobs_controller_test.rb4
2 files changed, 1 insertions, 5 deletions
diff --git a/app/controllers/blobs_controller.rb b/app/controllers/blobs_controller.rb
index d1ea70b..df6dd9d 100644
--- a/app/controllers/blobs_controller.rb
+++ b/app/controllers/blobs_controller.rb
@@ -85,7 +85,7 @@ class BlobsController < ApplicationController
redirect_to project_repository_path(@project, @repository) and return
end
expires_in 30.minutes
- headers["Content-Disposition"] = %[attachment;filename="#{@blob.name}"]
+# headers["Content-Disposition"] = %[attachment;filename="#{@blob.name}"]
render :text => @blob.data, :content_type => @blob.mime_type
end
end
diff --git a/test/functional/blobs_controller_test.rb b/test/functional/blobs_controller_test.rb
index a37db1b..180a281 100644
--- a/test/functional/blobs_controller_test.rb
+++ b/test/functional/blobs_controller_test.rb
@@ -120,7 +120,6 @@ class BlobsControllerTest < ActionController::TestCase
blob_mock.expects(:data).returns("blabla")
blob_mock.expects(:size).returns(200.kilobytes)
blob_mock.expects(:mime_type).returns("text/plain")
- blob_mock.expects(:name).returns("README.doc")
commit_stub = mock("commit")
commit_stub.stubs(:id).returns("a"*40)
commit_stub.stubs(:tree).returns(commit_stub)
@@ -139,7 +138,6 @@ class BlobsControllerTest < ActionController::TestCase
assert_equal "blabla", @response.body
assert_equal "text/plain", @response.content_type
assert_equal "max-age=1800, private", @response.headers['Cache-Control']
- assert_equal %[attachment;filename="README.doc"], @response.headers["Content-Disposition"]
end
should "get the blob data from a blob sha and render it as text/plain" do
@@ -255,7 +253,6 @@ class BlobsControllerTest < ActionController::TestCase
blob_mock.expects(:data).returns("blabla")
blob_mock.expects(:size).returns(200.kilobytes)
blob_mock.expects(:mime_type).returns("text/plain")
- blob_mock.expects(:name).returns("README.doc")
commit_stub = mock("commit")
commit_stub.stubs(:id).returns("a"*40)
commit_stub.stubs(:tree).returns(commit_stub)
@@ -321,7 +318,6 @@ class BlobsControllerTest < ActionController::TestCase
blob_mock.expects(:data).returns("blabla")
blob_mock.expects(:size).returns(200.kilobytes)
blob_mock.expects(:mime_type).returns("text/plain")
- blob_mock.expects(:name).returns("README.doc")
commit_stub = mock("commit")
commit_stub.stubs(:id).returns("a"*40)
commit_stub.stubs(:tree).returns(commit_stub)