-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
v2Version 2 related issuesVersion 2 related issues
Description
Overview
Implement comprehensive network handling for ParseURL including HTTP response metadata, conditional requests, and request configuration using the RequestOptions sub-struct from #244.
Tasks
Request Configuration
- Use RequestOptions from ParseOptions for HTTP configuration:
- Apply custom
Client
if provided - Set
Timeout
on HTTP client - Set
UserAgent
header - Apply
AuthConfig
for basic auth
- Apply custom
Conditional Requests
- Implement conditional request support:
- Send
If-None-Match
header whenIfNoneMatch
is set in RequestOptions - Send
If-Modified-Since
header whenIfModifiedSince
is set - Return
ErrNotModified
for 304 responses - Handle 304 responses gracefully
- Send
Response Metadata
-
Add
ResponseMetadata
struct togofeed.Feed
:type ResponseMetadata struct { StatusCode int ETag string LastModified time.Time CacheControl struct { MaxAge *time.Duration MustRevalidate bool NoCache bool NoStore bool } RetryAfter *time.Time Expires *time.Time }
-
Parse and populate HTTP headers:
-
ETag
response header -
Last-Modified
header (parse HTTP date) -
Cache-Control
directives (max-age, must-revalidate, no-cache, no-store) -
Retry-After
header (both HTTP-date and delay-seconds formats) -
Expires
header
-
Testing & Documentation
- Add comprehensive tests for all network functionality
- Document usage patterns for:
- Conditional requests to reduce bandwidth
- Cache control interpretation
- Retry-After handling for rate limiting
Benefits
- Enable proper HTTP caching strategies
- Support conditional requests to reduce unnecessary fetches
- Provide scheduling hints from HTTP headers
- Better HTTP client configuration support
Related Issues
- Add support for Etag, Last-Modified, If-None-Match and If-Modified-Since http headers on request and response #111 (HTTP ETag, Last-Modified, conditional requests)
- Add support proxy setting for parserURL #165 (Proxy/custom HTTP client support)
- Please consider exposing skipHours (in shared model) #228 (Scheduling hints)
- v2: Implement ParseOptions and Update Parser API #244 (ParseOptions implementation)
Parent Issue
- RFC: gofeed v2 – Proposed Changes #241 (RFC: gofeed v2)
tetafro
Metadata
Metadata
Assignees
Labels
v2Version 2 related issuesVersion 2 related issues