Skip to content

Commit

Permalink
Call dup not to overwrite original value
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
  • Loading branch information
ganmacs committed Jan 24, 2020
1 parent 38f80c5 commit abb50a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/fluent/config/section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def to_h
@params
end

def dup
Section.new(@params.dup, @corresponding_config_element.dup)
end

def +(other)
Section.new(self.to_h.merge(other.to_h))
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin_helper/http_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def stop
private

def _http_server_overwrite_config(config, opts)
conf = config
conf = config.dup
Fluent::PluginHelper::Server::SERVER_TRANSPORT_PARAMS.map(&:to_s).each do |param|
if opts.key?(param)
conf[param] = opts[param]
Expand Down

0 comments on commit abb50a8

Please sign in to comment.