Merge branch 'stable-2.9'
* stable-2.9: Fix JS resource loading for JsPlugin type (was returning 404) Change-Id: Ia403a7faf97ab6fe167eaf08ebc71cb0ba758807
This commit is contained in:
@@ -608,7 +608,7 @@ class HttpPluginServlet extends HttpServlet
|
||||
private void sendJsPlugin(Plugin plugin, ResourceKey key,
|
||||
HttpServletRequest req, HttpServletResponse res) throws IOException {
|
||||
File pluginFile = plugin.getSrcFile();
|
||||
if (req.getPathInfo().equals(getJsPluginPath(plugin)) && pluginFile.exists()) {
|
||||
if (req.getRequestURI().equals(getJsPluginPath(plugin)) && pluginFile.exists()) {
|
||||
res.setHeader("Content-Length", Long.toString(pluginFile.length()));
|
||||
res.setContentType("application/javascript");
|
||||
writeToResponse(res, new FileInputStream(pluginFile));
|
||||
@@ -619,7 +619,7 @@ class HttpPluginServlet extends HttpServlet
|
||||
}
|
||||
|
||||
private static String getJsPluginPath(Plugin plugin) {
|
||||
return String.format("%s/static/%s", plugin.getName(), plugin.getSrcFile()
|
||||
return String.format("/plugins/%s/static/%s", plugin.getName(), plugin.getSrcFile()
|
||||
.getName());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user