Skip to content

jsonp #24

@imonly

Description

@imonly

Please change jsonp "Content-Type" to "application/javascript"

public $contentTypeJson = 'application/json';
public $contentTypeJsonp = 'application/javascript';

if($jsonp_callback !== null){
$app->response()->header('Content-Type', $this->contentTypeJsonp);
$app->response()->body($jsonp_callback.'('.json_encode($response, $this->encodingOptions).')');
} else {
$app->response()->header('Content-Type', $this->contentTypeJson);
$app->response()->body(json_encode($response, $this->encodingOptions));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions