-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong redirects when using Volto ? #152
Comments
@mamico This is the same problem outlined in plone/volto#4800. I think (2) is the solution. api redirect should include ++api++ in it even with VHM. |
Yes. Exactly the same. Thanks But I do not know whether the solution could also be, simply: change VHM currently used in Volto (as in documentation and as default for development) http://localhost:8080/VirtualHostBase/http/localhost:3000/Plone/++api++/VirtualHostRoot/foo to http://localhost:8080/VirtualHostBase/http/localhost:3000/Plone/VirtualHostRoot/++api++/foo \cc @sneridagh |
@mamico How you do your VHM is up to the user. We use the internal VHM rules and this bug is breaking volto for us. We have already done a PR on volto to fix the fact that volto relies on this bug + the specific VHM config to work currently - plone/volto#4834 |
This was fixed a while back in plone/volto#4854 |
While working on pull requests plone/volto#4821 and plone/volto#4826, I encountered the following anomalous behavior:
The page "foo" was renamed to "bar".
Volto published with seamless mode.
Inside a page, there is a REST API call, for example, a GET_CONTENT request to "/foo".
The call is transformed into a backend request like this (managed by superagent or the browser):
wget http://localhost:8080/VirtualHostBase/http/localhost:3000/Plone/++api++/VirtualHostRoot/foo -S --header="Accept: application/json"
The backend responds with:
At this point, superagent (or the browser) autonomously follows the redirect and makes a request that returns an HTML response, which is then ignored and replaced with a 301 exception here:
https://github.com/plone/volto/blob/9c5b4ccf94281e2849ca9b66e74cafe7f5ef87cb/src/helpers/Api/Api.js#L102
However, in a block, this exception might not be correctly handled, and actually would probably not be the most appropriate way to handle it.
Personally, I see two approaches to address this issue (the first being my preferred option):
The text was updated successfully, but these errors were encountered: