Skip to content

Commit

Permalink
SLING-9768 - The org.apache.sling.api.scripting.SlingScript#getScript…
Browse files Browse the repository at this point in the history
…Resource implementations should not leak the scripting resolver

* switched to the request resource resolver for the script resource
  • Loading branch information
raducotescu committed Sep 25, 2020
1 parent 7a88e41 commit 714cc2d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public ExecutableContext prepareScriptContext(SlingHttpServletRequest request, S
bindings.put(SlingBindings.OUT, response.getWriter());
Logger scriptLogger = LoggerFactory.getLogger(executable.getName());
bindings.put(SlingBindings.LOG, scriptLogger);
bindings.put(SlingBindings.SLING, new ScriptHelper(executable.getBundleContext(), new SlingScriptAdapter(scriptingResourceResolverProvider.getRequestScopedResourceResolver(), executable.getPath(), "sling/bundle/resource"), request, response));
bindings.put(SlingBindings.SLING, new ScriptHelper(executable.getBundleContext(), new SlingScriptAdapter(request.getResourceResolver(),
executable.getPath(), "sling/bundle/resource"), request, response));
bindings.put(BundledRenderUnit.VARIABLE, executable);
bindings.put(ScriptEngine.FILENAME, executable.getPath());
bindings.put(ScriptEngine.FILENAME.replaceAll("\\.", "_"), executable.getPath());
Expand Down

0 comments on commit 714cc2d

Please sign in to comment.