Vote #80592
完了X-Sendfile header field is not set if rack 2.1.0 is installed
0%
説明
$ bin/rails test test/integration/attachments_test.rb Rack::File is deprecated, please use Rack::Files instead. Run options: --seed 34165 # Running: F Failure: AttachmentsTest#test_download_should_set_sendfile_header [/private/tmp/redmine-trunk/test/integration/attachments_test.rb:156]: Expected nil to not be nil. bin/rails test test/integration/attachments_test.rb:150
journals
Temporary fix for this issue:
<pre><code class="diff">
diff --git a/Gemfile b/Gemfile
index f5428377d..657545d84 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,6 +15,9 @@ gem "nokogiri", "~> 1.10.0"
gem "i18n", "~> 1.6.0"
gem "rbpdf", "~> 1.20.0"
+# TODO: Remove the following line when #32785 (AttachmentsTest fails if rack 2.1.0 is installed) is fixed
+gem 'rack', '~> 2.0.8'
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]
</code></pre>
--------------------------------------------------------------------------------
this is related to https://www.redmine.org/issues/24646
@GO MAEDA take a look at https://github.com/rack/rack/pull/1463 for the potential fix
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Pavel Rosický wrote:
> @GO MAEDA take a look at https://github.com/rack/rack/pull/1463 for the potential fix
Thank you, I have read the page and confirmed that the following patch fixes this issue.
<pre><code class="diff">
diff --git a/config/application.rb b/config/application.rb
index a06ee4dba..86b695d42 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -60,7 +60,7 @@ module RedmineApp
config.active_record.sqlite3.represent_boolean_as_integer = true
# Sets the Content-Length header on responses with fixed-length bodies
- config.middleware.insert_after Rack::Sendfile, Rack::ContentLength
+ config.middleware.insert_before Rack::Sendfile, Rack::ContentLength
# Verify validity of user sessions
config.redmine_verify_sessions = true
</code></pre>
Setting the target version to 4.0.7.
--------------------------------------------------------------------------------
Committed the fix.
--------------------------------------------------------------------------------
related_issues
relates,Closed,24646,X-Sendfile is missing in response headers