Skip to content

Commit

Permalink
Use dup instead of String.new
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Selder committed Jul 20, 2016
1 parent 746e245 commit 0fd085c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinatra/base.rb
Expand Up @@ -358,7 +358,7 @@ def content_type(type = nil, params = {})
# Set the Content-Disposition to "attachment" with the specified filename,
# instructing the user agents to prompt to save.
def attachment(filename = nil, disposition = :attachment)
response['Content-Disposition'] = String.new(disposition.to_s)
response['Content-Disposition'] = disposition.to_s.dup
if filename
params = '; filename="%s"' % File.basename(filename)
response['Content-Disposition'] << params
Expand Down

0 comments on commit 0fd085c

Please sign in to comment.