.vbw-planning/milestones/polish-and-reliability/phases/01-backend-fixes/PLAN-01.md
Update default HTTP headers to reduce bot-blocking: browser-like User-Agent, broader Accept, Accept-Language, DNT, and per-source Referer header.
@lib/source_monitor/http.rb -- DEFAULT_USER_AGENT (line 17), default_headers (lines 89-97)@lib/source_monitor/configuration/http_settings.rb -- default_user_agent (lines 44-46)@lib/source_monitor/fetching/feed_fetcher.rb -- request_headers (lines 104-111)@test/lib/source_monitor/http_test.rb -- header assertions (lines 92-97, 111)REQ-UA-01: Change default User-Agent from "SourceMonitor/VERSION" to a browser-like string.
Files: lib/source_monitor/http.rb, lib/source_monitor/configuration/http_settings.rb
http.rb line 17, change DEFAULT_USER_AGENT to "Mozilla/5.0 (compatible; SourceMonitor/#{SourceMonitor::VERSION})"http_settings.rb line 45, update default_user_agent to return the same string: "Mozilla/5.0 (compatible; SourceMonitor/#{SourceMonitor::VERSION})"Files: lib/source_monitor/http.rb
In default_headers method (lines 89-97):
"text/html, application/rss+xml, application/atom+xml, application/json;q=0.9, text/xml;q=0.8""Accept-Language" => "en-US,en;q=0.9""DNT" => "1"Files: lib/source_monitor/fetching/feed_fetcher.rb
In request_headers method (lines 104-111), after transforming custom_headers:
headers["Referer"] = source.website_url if source.website_url.present?Files: test/lib/source_monitor/http_test.rb, test/lib/source_monitor/fetching/feed_fetcher_test.rb
In http_test.rb:
text/html prefixen-US,en;q=0.9 and "1"Mozilla/5.0 and SourceMonitor/In feed_fetcher_test.rb (or create new test section):
| Action | Path |
|---|---|
| MODIFY | lib/source_monitor/http.rb |
| MODIFY | lib/source_monitor/configuration/http_settings.rb |
| MODIFY | lib/source_monitor/fetching/feed_fetcher.rb |
| MODIFY | test/lib/source_monitor/http_test.rb |
| MODIFY | test/lib/source_monitor/fetching/feed_fetcher_test.rb |
bin/rails test test/lib/source_monitor/http_test.rb test/lib/source_monitor/fetching/feed_fetcher_test.rb
bin/rubocop lib/source_monitor/http.rb lib/source_monitor/configuration/http_settings.rb lib/source_monitor/fetching/feed_fetcher.rb
Mozilla/5.0 and SourceMonitor/text/html