volto icon indicating copy to clipboard operation
volto copied to clipboard

return a 302 Redirect when visiting the link view

Open erral opened this issue 2 years ago • 7 comments

Fixes #3302

This way search engines get proper HTTP 302 Redirects.

erral avatar May 03 '22 13:05 erral

Deploy Preview for volto canceled.

Name Link
Latest commit ce339b879a36864199dc9a7f4dbabeacbfcd882b
Latest deploy log https://app.netlify.com/sites/volto/deploys/64a3f6847c826b0008e88c19

netlify[bot] avatar May 03 '22 13:05 netlify[bot]



Test summary

410 0 20 0


Run details

Project Volto
Status Passed
Commit fe0b004f92
Started Oct 15, 2022 4:19 PM
Ended Oct 15, 2022 4:31 PM
Duration 12:02 💡
OS Linux Ubuntu - 20.04
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

cypress[bot] avatar May 03 '22 13:05 cypress[bot]

@erral we are removing code that I think fixed some similar issues with the redirects in SSR. Do the <Redirect> component works in SSR?

sneridagh avatar May 05 '22 15:05 sneridagh

I have tested it both in browser and calling it with wget and curl and we get the HTTP redirect, that's what you mean?

erral avatar May 05 '22 15:05 erral

Anyway I tried to add a test to this and I got an InvariantError saying that I should not be using the <Redirect> component out of a <Router> component, so I don't know whether this is a correct approach to return a proper HTTP Redirect :confused:

erral avatar May 05 '22 15:05 erral

@erral try wrap it in a <MemoryRouter>, there are some examples in the current tests.

sneridagh avatar May 22 '22 09:05 sneridagh

Yes I tried that in the other PR, the RedirectBlock one, and it was OK, so now I have to take the time to bring that test here

erral avatar May 22 '22 16:05 erral