Skip to content

Commit 777245c

Browse files
committed
Allow findByName to return jsonified package data from API
1 parent 5199a5f commit 777245c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/controllers/PackageController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
return res.rstudio_redirect(301, '/search?q=' + encodeURIComponent(packageName));
5959
// there seems to be a problem with redirected requests if text/html is set as contentype for the ajax request, so I just
6060
// adapt this so Rstudio still gets the html
61-
} else if (req.wantsJSON && !req.param('viewer_pane') == 1) {
61+
} else if ((req.wantsJSON || req.path.startsWith('/api/')) && !req.param('viewer_pane') == 1) {
6262
_package = _package.toJSON();
6363
_package.type = 'package';
6464
return res.json(_package);

0 commit comments

Comments
 (0)