Skip to content
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

Use query middleware with get request #16

Open
Orkin opened this issue Apr 27, 2018 · 1 comment
Open

Use query middleware with get request #16

Orkin opened this issue Apr 27, 2018 · 1 comment

Comments

@Orkin
Copy link

Orkin commented Apr 27, 2018

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

@prolic
Copy link
Member

prolic commented Apr 29, 2018

@Orkin don't worry for dependency on prooph/service-bus. This middleware is intended to bridge prooph's service bus and a support for any other bus component will never happen within this project. If someone is planning to do the same for SimpleBus, they have to create their own middlewares for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants