I ran into a little trouble trying to enable the Cors filter. It sets headers in the Yii:$app->getResponse() object, but the runAction() method would return an entirely new Response object, so the response headers would be lost.
With this commit, we just set the format and data properties of the existing Response object and return it.
I think this is a relatively simple fix, but if there was a reason a new Response object was being created, then we should discuss it before merging this in, since there might be a better solution (like copying over headers from the existing Response object).
I ran into a little trouble trying to enable the Cors filter. It sets headers in the
Yii:$app->getResponse()
object, but therunAction()
method would return an entirely new Response object, so the response headers would be lost.With this commit, we just set the
format
anddata
properties of the existing Response object and return it.I think this is a relatively simple fix, but if there was a reason a new Response object was being created, then we should discuss it before merging this in, since there might be a better solution (like copying over headers from the existing Response object).