validate will send forem feeds importer user agent, just like import (#16925)

follow on to #15942 which enabled downloading existing DEV feeds, this
allows setting a feed url to DEV.

It's possible this user agent should be brought inline with the
tags choice of community name and url, but in the short term I'm
making this consistent with the existing feed importer.
This commit is contained in:
Daniel Uber 2022-03-21 16:43:24 -05:00 committed by GitHub
parent d12d3b3ef1
commit 6869917904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,9 @@ module Feeds
def call
return false if feed_url.blank?
xml = HTTParty.get(feed_url, timeout: 10).body
xml = HTTParty.get(feed_url,
timeout: 10,
headers: { "User-Agent" => "Forem Feeds Importer" }).body
Feedjira.parse(xml)
true