Skip to content

Commit

Permalink
Merge pull request #546 from ONLYOFFICE/fix/ruby-saveas-url-in-docker
Browse files Browse the repository at this point in the history
fix(ruby): replacing file_url host in saveas. Fix Bug 66874
  • Loading branch information
LinneyS authored Mar 14, 2024
2 parents 8fdbdb9 + c6eff10 commit ed39928
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,10 @@ def download
# Save Copy as...
def saveas
body = JSON.parse(request.body.read)
file_url = body['url']
file_url = body['url'].sub(
HomeController.config_manager.document_server_public_uri.to_s,
HomeController.config_manager.document_server_private_uri.to_s
)
title = body['title']
file_name = DocumentHelper.get_correct_name(title, nil)
extension = File.extname(file_name).downcase
Expand Down Expand Up @@ -377,7 +380,7 @@ def saveas
render(plain: "{\"file\" : \"#{file_name}\"}")
nil
rescue StandardError => e
render(plain: "{\"error\":1, \"message\": \"#{e.message}\"}")
render(plain: JSON.generate({ error: 1, message: e.message }))
nil
end

Expand Down

0 comments on commit ed39928

Please sign in to comment.