Skip to content

Commit d1f0fb2

Browse files
committed
fix: responds with http status 422
1 parent 097fa23 commit d1f0fb2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,16 @@ def self.development? = ENV['RACK_ENV'] == 'development'
9090
config = Html2rss::Configs.find_by_name(name)
9191

9292
if (params = request.params).any?
93+
config = config.dup
9394
config[:params] ||= {}
9495
config[:params].merge!(params)
9596
end
9697

98+
unless config[:strategy]
99+
config = config.dup if config.frozen?
100+
config[:strategy] ||= Html2rss::RequestService.default_strategy_name
101+
end
102+
97103
feed = Html2rss.feed(config)
98104

99105
HttpCache.expires(response, feed.channel.ttl.to_i * 60, cache_control: 'public')
@@ -107,10 +113,16 @@ def self.development? = ENV['RACK_ENV'] == 'development'
107113
config = LocalConfig.find(File.basename(config_name_with_ext, '.*'))
108114

109115
if (params = request.params).any?
116+
config = config.dup
110117
config[:params] ||= {}
111118
config[:params].merge!(params)
112119
end
113120

121+
unless config[:strategy]
122+
config = config.dup if config.frozen?
123+
config[:strategy] ||= Html2rss::RequestService.default_strategy_name
124+
end
125+
114126
feed = Html2rss.feed(config)
115127

116128
HttpCache.expires(response, feed.channel.ttl.to_i * 60, cache_control: 'public')

0 commit comments

Comments
 (0)