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

Wrong mime type for JSONP response #27

Open
weierophinney opened this issue Dec 31, 2019 · 1 comment
Open

Wrong mime type for JSONP response #27

weierophinney opened this issue Dec 31, 2019 · 1 comment

Comments

@weierophinney
Copy link
Member

If I set a JSONP callback to my JSON view model, the returned mime type is application/json instead of application/javascript. This is due to the JsonStrategy which checks if the JsonRenderer has a JSONP callback to switch the mime type. But the JsonRenderer doesn't have a JSONP callback, only my view model has one.

As a workaround, I now set the callback to the renderer ($this->getServiceLocator()->get('ViewJsonRenderer')->setJsonpCallback($callback);).


Originally posted by @rohm1 at zendframework/zend-view#41

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

1 participant