add content type for html reponses
This commit is contained in:
parent
430f485998
commit
d8add0409c
@ -200,6 +200,7 @@ module RedmineDmsf
|
||||
if collection?
|
||||
html_display
|
||||
response['Content-Length'] = response.body.bytesize.to_s
|
||||
response['Content-Type'] = 'text/html'
|
||||
else
|
||||
raise Forbidden unless User.current.admin? || User.current.allowed_to?(:view_dmsf_files, project)
|
||||
response.body = download # Rack based provider
|
||||
|
||||
@ -68,6 +68,7 @@ module RedmineDmsf
|
||||
def get(request, response)
|
||||
html_display
|
||||
response['Content-Length'] = response.body.bytesize.to_s
|
||||
response['Content-Type'] = 'text/html'
|
||||
OK
|
||||
end
|
||||
|
||||
|
||||
@ -97,6 +97,7 @@ module RedmineDmsf
|
||||
def get(request, response)
|
||||
html_display
|
||||
response['Content-Length'] = response.body.bytesize.to_s
|
||||
response['Content-Type'] = 'text/html'
|
||||
OK
|
||||
end
|
||||
|
||||
|
||||
@ -41,6 +41,13 @@ class DmsfWebdavGetTest < RedmineDmsf::Test::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def test_should_include_response_headers
|
||||
get '/dmsf/webdav', params: nil, headers: @admin
|
||||
assert_response :success
|
||||
assert_equal 'text/html', response.headers['Content-Type']
|
||||
assert response.headers['Content-Length'].to_i > 0, "Content-Length should be > 0, but was #{response.headers['Content-Length']}"
|
||||
end
|
||||
|
||||
def test_should_list_dmsf_enabled_project
|
||||
get '/dmsf/webdav', params: nil, headers: @admin
|
||||
assert_response :success
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user