Comments (6)
That would be awesome indeed if Harmony could work well with third party middlewares! So thank you really much for the report as the current mechanism wasn't intentional. :)
Could you tell me other details about your setup? Did you use any official Harmony middleware along with the CORS one? If so, I do hope the only problem is that Harmony's middlewares don't return a response (as you said in the title of the issue).
from harmony.
I just pushed the fixes to the master branch! Could you ensure if it works for you?
from harmony.
hi @kocsismate , after this modification, everything works. Below is my setup:
$app
->addMiddleware('cors', $corsMiddleware)
->addMiddleware("fast_route", new FastRouteMiddleware($router))
->addMiddleware("dispatcher", new DispatcherMiddleware($container))
->addFinalMiddleware("responder", new DiactorosResponderMiddleware(new SapiEmitter()));
Actually I am also working with your yin-middlewares
, I think there are also some modifications needed. For example, in JsonApiDispatcherMiddleware.php
an ErrorDocument
is returned directly from the middleware:
// JsonApiDispatcherMiddleware.php
...
if ($callable === null) {
return $this->getDispatchErrorDocument($this->getDispatchError())->getResponse($response);
}
...
from harmony.
Good job with the PR, I'll release Harmony 2.3 shortly with this fix! Your comment on Yin-middlewares is also valid, I'll address it soon.
from harmony.
I've done with the release: Harmony will trigger a deprecated notice if a middleware returns with a Response.
from harmony.
good news!
from harmony.
Related Issues (11)
- Add better support for dispatching middleware conditionally HOT 4
- Improve the Read Me HOT 3
- new install error HOT 2
- Lazy Loading? HOT 5
- LaminasEmitterMiddleware not available in the middleware HOT 1
- Middleware interface design HOT 6
- Any plan to release a new version? (for PHP 8 support) HOT 1
- What's the point of the "terminated" property? HOT 1
- Use StyleCI for CS checks AND fix HOT 1
- A few travis config observations HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harmony.