Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Spomsoree
Copy link
Contributor

No description provided.

@bobdenotter
Copy link
Member

Hi @Spomsoree,

Dumb question, but why would it be better to use 302 as default?

@Spomsoree
Copy link
Contributor Author

302 is the current default by symfony: https://github.com/symfony/http-foundation/blob/18f8a2a3ab703428143c27c055fd743ab7e7dcb1/RedirectResponse.php#L35

I did not want to change that for current installations.

1 similar comment
@Spomsoree
Copy link
Contributor Author

302 is the current default by symfony: https://github.com/symfony/http-foundation/blob/18f8a2a3ab703428143c27c055fd743ab7e7dcb1/RedirectResponse.php#L35

I did not want to change that for current installations.

@bobdenotter
Copy link
Member

There is a simple difference between a 301 and 302 redirect: a 301 redirect indicates that a page has permanently moved to a new location, meanwhile, a 302 redirect says that the page has moved to a new location, but that it is only temporary.

Personally, I use this most often for permanent redirects (so they get updated as such in Google), and I'd suspect it's most often used for that.

Would it be acceptable if we merge this in, but set the default to 301? That way it's no BC-break for existing user, but people can use 302 if they prefer..

@Spomsoree
Copy link
Contributor Author

@bobdenotter the current version does a 302.
I think 301 makes more sense, but people who have this installed are getting a 302, so it would be a BC if I'd change that.

No parameter is passed here: https://github.com/bolt/redirector/blob/master/src/RedirectSubscriber.php#L40
Thats why it defaults to 302 here: https://github.com/symfony/http-foundation/blob/18f8a2a3ab703428143c27c055fd743ab7e7dcb1/RedirectResponse.php#L35

@bobdenotter
Copy link
Member

@bobdenotter the current version does a 302.

Ah, hmm, right.. Let's get this merged as-is, then! 👍

Thanks, @Spomsoree

@bobdenotter bobdenotter merged commit 87c54f7 into bolt:master Sep 29, 2022
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.

2 participants