Skip to content

[HttpFoundation] setContent missing in Request class #48357

Closed as not planned
Closed as not planned
@luxferoo

Description

@luxferoo

Description

I'm currently implementing an event subscriber to sanitize http inputs but I'm not able to access to $content because it's protected while $request is public. Is it possible to add a setter ? otherwise anyone with the same need is forced to use Request::initialize like the following :

  $event->getRequest()->initialize(
            $request->query->getIterator()->getArrayCopy(),
            $sanitizedRequest,
            $request->attributes->getIterator()->getArrayCopy(),
            $request->cookies->getIterator()->getArrayCopy(),
            $request->files->getIterator()->getArrayCopy(),
            $request->server->getIterator()->getArrayCopy(),
            $sanitizedContent,
        );

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    HttpFoundationRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions