Skip to content

Use query middleware with get request #16

@Orkin

Description

@Orkin

For now it's not possible to use get request with query middleware. It's only working with post request, is it a intended ?

I think it can be useful in case we use only one query to allow get request like it's possible with CommandMiddleware. We just need to set \Prooph\HttpMiddleware\QueryMiddleware::NAME_ATTRIBUTE to the request attribute.

One more thing, with the post request we have "dependencies" with prooph component because client have to send the attribute prooph_query_name inside. If for any reason we need to change for an other command bus clients could not working or with a weird parameter that do not have any sense.

So I suggest to allow query middleware to handle get request with this purpose :

  • if the request is post we do not change the behavior
  • if the request is get we check request attribute like for CommandMiddleware

I propose to use this lib to check request method : fig/http-message-util

Whate do you think ? @prolic @codeliner @basz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions