Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-02 09:28:48 +0300
committerStan Hu <stanhu@gmail.com>2015-09-02 10:20:05 +0300
commit551157960e70363d35a9b24d79780c9b98c9ef3b (patch)
tree389ee163a02a1146ddd693a8ad7dcff4d5c075b3 /spec/controllers
parent308c6428aef2a46b0370a24d85a97b0e133283a8 (diff)
Remove the filename argument from Content-Disposition header to avoid
RFC 5987 and RFC 6266 encoding issues. This change allows the browser to determine the filename based on the URL. See: http://greenbytes.de/tech/tc2231/ Closes https://github.com/gitlabhq/gitlabhq/issues/9595 Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/1829
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/raw_controller_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/projects/raw_controller_spec.rb b/spec/controllers/projects/raw_controller_spec.rb
new file mode 100644
index 00000000000..1f921d5f05d
--- /dev/null
+++ b/spec/controllers/projects/raw_controller_spec.rb
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe Projects::RawController do
+ let(:public_project) { create(:project, :public) }
+
+ describe "#show" do
+ context 'regular filename' do
+ let(:id) { 'master/README.md' }
+
+ it 'delivers ASCII file' do
+ get(:show,
+ namespace_id: public_project.namespace.to_param,
+ project_id: public_project.to_param,
+ id: id)
+
+ expect(response.status).to eq(200)
+ expect(response.header['Content-Type']).to eq('text/plain; charset=utf-8')
+ expect(response.header['Content-Disposition']).
+ to eq("inline")
+ end
+ end
+ end
+end