プロジェクト

全般

プロフィール

Vote #80592

完了

X-Sendfile header field is not set if rack 2.1.0 is installed

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Attachments_19
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
19
version_id:
159
issue_org_id:
32785
author_id:
332
assigned_to_id:
332
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

$ 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

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0