Skip to content

Unlocking content does not work when using the development proxy #5602

Description

@teekuningas

I am running volto in a local project, using:

RAZZLE_DEV_PROXY_API_PATH=http://localhost:8080/Plone yarn start

Upon exiting the edit view, the content fails to unlock, although it locks without issue. Investigation reveals that while actions are dispatched correctly, the DELETE request stalls at the development proxy. The issue appears to stem from the action's payload containing "{}" when force is set to false:

https://github.com/plone/volto/blob/main/packages/volto/src/actions/content/content.js#L232

Subsequently, this payload is discarded here:

https://github.com/plone/volto/blob/main/packages/volto/src/express-middleware/devproxy.js#L51

The probable cause of the hang is the discrepancy between a content-length of 2 and the absence of a body. It seems an upstream version, which the Volto code is believed to be derived from, has addressed this issue:

chimurai/http-proxy-middleware#640

The unlocking process operates correctly when using an nginx proxy, following the Plone documentation guidelines.

This problem is likely present in the master branch; however, my Volto version is 16.21.3, so that may be a factor.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions