Skip to content

permanent redirect status code instead of found#3757

Closed
francesco-gaglione wants to merge 3 commits intoactix:masterfrom
francesco-gaglione:files_redirect_status_code
Closed

permanent redirect status code instead of found#3757
francesco-gaglione wants to merge 3 commits intoactix:masterfrom
francesco-gaglione:files_redirect_status_code

Conversation

@francesco-gaglione
Copy link
Copy Markdown
Contributor

@francesco-gaglione francesco-gaglione commented Sep 4, 2025

PR Type

Close #3543

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

@robjtede
Copy link
Copy Markdown
Member

robjtede commented Sep 4, 2025

I agree Found is less appropriate but permanent redirects are a risky default for a framework due to their caching implications.

I'd accept a change to TemporaryRedirect or allow a customization.

@francesco-gaglione
Copy link
Copy Markdown
Contributor Author

francesco-gaglione commented Sep 5, 2025

@robjtede if customization is prefered I can try to work on it. I wa thinking to change redirect_to_slash bolean to an Option containint the redirect mode. What do you think?
I can work on it on a different PR if prefered leaving here the TemporaryRedirect

@robjtede robjtede added A-files project: actix-files B-semver-patch labels Sep 9, 2025
@robjtede
Copy link
Copy Markdown
Member

robjtede commented Sep 9, 2025

change redirect_to_slash

a new method would be preferred to avoid breaking changes, but in spirit i agree it's a good path to take

@francesco-gaglione
Copy link
Copy Markdown
Contributor Author

@robjtede working on it. This merge request will be obsolete and will be included in the new one.

@francesco-gaglione
Copy link
Copy Markdown
Contributor Author

Opened #3767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-files project: actix-files B-semver-patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files::redirect_to_slash_directory() should use HTTP status code 308

2 participants