Skip to content

Wrong mime type for JSONP response #27

@weierophinney

Description

@weierophinney

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

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