Skip to content

fix: treat HTTP 301 as permanent redirect - #829

Open
xhon-pelushi wants to merge 1 commit into
bitfireAT:mainfrom
xhon-pelushi:fix/824-http-301-permanent-redirect
Open

fix: treat HTTP 301 as permanent redirect#829
xhon-pelushi wants to merge 1 commit into
bitfireAT:mainfrom
xhon-pelushi:fix/824-http-301-permanent-redirect

Conversation

@xhon-pelushi

Copy link
Copy Markdown

Treat HTTP 301 the same as 308 for permanent redirect handling when saving calendar URLs.

Fixes #824

Test plan

  • Review diff against issue
  • Run project lint/tests if applicable

CalendarFetcher.onRedirect() matched HttpStatusCode.NotModified (304)
instead of HttpStatusCode.MovedPermanently (301) when deciding whether
a redirect is permanent. Since a 304 never reaches onRedirect() (it is
intercepted earlier by fetchNetwork()), that branch was dead code, and
real 301 responses fell into the temporary-redirect branch: the stored
subscription URL was never updated via onNewPermanentUrl(), causing
the 301 to be re-followed on every sync.

Fixes bitfireAT#824
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.

301 "Moved Permanently" redirect is not recognized as permanent (new URL is never saved)

1 participant