Skip to content

Conversation

@ElectricTea
Copy link

Some feeds are Content-Type application/xml only and will respond with a 406 error to responses with a header of content type application/rss+xml. This change allows for the more permissive content types application/xml and text/xml to be accepted.

Also fixes "UserAgent" header key with correct "User-Agent".

Some feeds are Content-Type application/xml only and will respond with a 406 error to responses with a header of content type application/rss+xml. This change allows for the more permissive content types application/xml and text/xml to be accepted

Also fixes UserAgent with correct User-Agent
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

Updated HTTP request headers in the feed worker: corrected header name from UserAgent to User-Agent and broadened the Accept header to include multiple XML/RSS media types with quality weights.

Changes

Cohort / File(s) Summary
Feed Worker HTTP Headers
apps/workers/workers/feedWorker.ts
Corrected UserAgent header to User-Agent; expanded Accept from application/rss+xml to application/rss+xml, application/xml;q=0.9, text/xml;q=0.8 to accept additional XML variants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly summarizes the main changes: fixing the User-Agent header and accepting more permissive RSS feed content types.
Description check ✅ Passed The pull request description is directly related to the changeset, explaining the rationale for accepting broader content types and fixing the header key.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6896392 and 212de2f.

📒 Files selected for processing (1)
  • apps/workers/workers/feedWorker.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript for type safety in all source files

Files:

  • apps/workers/workers/feedWorker.ts
**/*.{ts,tsx,js,jsx,json,css,md}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier according to project standards

Files:

  • apps/workers/workers/feedWorker.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Lint code using oxlint and fix issues with pnpm lint:fix

Files:

  • apps/workers/workers/feedWorker.ts
🔇 Additional comments (2)
apps/workers/workers/feedWorker.ts (2)

159-160: LGTM! Correct HTTP header name.

The fix from UserAgent to "User-Agent" properly uses the standard HTTP header name, improving compatibility with servers that expect correctly formatted headers.


161-161: LGTM! Improved content negotiation.

The expanded Accept header with quality weights correctly prioritizes RSS-specific content types while gracefully accepting generic XML formats, which should prevent 406 errors from feeds that only serve application/xml or text/xml.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Jan 6, 2026

Greptile Summary

This PR fixes two issues in the RSS feed worker: corrects the HTTP header key from UserAgent to the standard "User-Agent", and expands the Accept header to support broader XML content types (application/xml and text/xml) with proper HTTP quality factors. This allows the worker to successfully fetch feeds from servers that only respond to more permissive content types and would otherwise return 406 errors.

Key Changes:

  • Fixed header key capitalization and format: UserAgent"User-Agent"
  • Enhanced content negotiation: application/rss+xmlapplication/rss+xml, application/xml;q=0.9, text/xml;q=0.8
  • Maintains proper HTTP Accept header syntax with quality factors (q-values) to prioritize specific format over generic XML types

Confidence Score: 5/5

  • This PR is safe to merge with no concerns. The changes are minimal, correct HTTP header fixes with no side effects or breaking changes.
  • Score of 5 reflects that this PR makes simple, straightforward bug fixes to HTTP header handling. The User-Agent header fix corrects a code error that would have prevented the header from being sent at all. The Accept header expansion is a safe, backwards-compatible improvement that follows HTTP standards for content negotiation. The changes are isolated to a single file's request headers with no impact on business logic or data handling. No dependencies are affected, and the quality factor syntax is valid and standard.
  • No files require special attention

Important Files Changed

Filename Overview
apps/workers/workers/feedWorker.ts Fixed HTTP header format: corrected UserAgent key to "User-Agent" and expanded Accept header to support more permissive XML content types (application/xml and text/xml) with proper quality factors for content negotiation.

Sequence Diagram

sequenceDiagram
    participant FeedWorker as Feed Worker
    participant fetchWithProxy as fetchWithProxy
    participant FeedServer as Feed Server
    participant Parser as RSS Parser

    FeedWorker->>fetchWithProxy: "Request feed with User-Agent and Accept headers"
    fetchWithProxy->>FeedServer: "HTTP GET with content negotiation"
    alt Server returns application/rss+xml
        FeedServer-->>fetchWithProxy: "200 OK (application/rss+xml)"
    else Server returns application/xml
        FeedServer-->>fetchWithProxy: "200 OK (application/xml)"
    else Server returns text/xml
        FeedServer-->>fetchWithProxy: "200 OK (text/xml)"
    end
    fetchWithProxy-->>FeedWorker: "Response with XML content"
    FeedWorker->>FeedWorker: "Validate content-type includes xml"
    FeedWorker->>Parser: "Parse XML feed"
    Parser-->>FeedWorker: "Parsed feed items"
    FeedWorker->>FeedWorker: "Process entries and create bookmarks"
Loading

@greptile-apps
Copy link

greptile-apps bot commented Jan 6, 2026

Greptile found no issues!

From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/workers/workers/feedWorker.ts (1)

161-161: Good expansion of accepted content types.

The Accept header now properly includes application/xml and text/xml with quality values, which will prevent 406 errors from feeds that return these content types instead of the more specific application/rss+xml. The quality value syntax is correct and establishes proper preference ordering.

Note: There appears to be trailing whitespace after the closing quote. Please run pnpm lint:fix to ensure formatting is consistent with project standards.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa7a81e and 6896392.

📒 Files selected for processing (1)
  • apps/workers/workers/feedWorker.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript for type safety in all source files

Files:

  • apps/workers/workers/feedWorker.ts
**/*.{ts,tsx,js,jsx,json,css,md}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier according to project standards

Files:

  • apps/workers/workers/feedWorker.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Lint code using oxlint and fix issues with pnpm lint:fix

Files:

  • apps/workers/workers/feedWorker.ts
🔇 Additional comments (1)
apps/workers/workers/feedWorker.ts (1)

159-160: Excellent fix for the User-Agent header.

The header key is now correctly spelled as "User-Agent" (with hyphen) per HTTP standards. The previous UserAgent key was non-standard and would have been ignored by servers.

@ElectricTea ElectricTea changed the title fix: Fix User-Agent key and accept more permissive content types fix: Accept more permissive RSS feed content types and Fix User-Agent key Jan 6, 2026
Fix formatting on HTTP Header for RSS Accceptable Content-Types introduced in commit 6896392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant