Skip to content

Commit

Permalink
Bugfix in api authentication to return JSON again
Browse files Browse the repository at this point in the history
  • Loading branch information
roberthorlings committed Jan 14, 2015
1 parent 4673715 commit ef57ee5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion grails-app/controllers/api/ApiController.groovy
Expand Up @@ -87,7 +87,14 @@ class ApiController {
response.status = 500
result = ['error':e.getMessage()]
}
return result

response.contentType = 'application/json;charset=UTF-8'

if (params.containsKey('callback')) {
render "${params.callback}(${result as JSON})"
} else {
render result as JSON
}
}

/**
Expand Down

0 comments on commit ef57ee5

Please sign in to comment.