raducotescu commented on code in PR #33:
URL: 
https://github.com/apache/sling-org-apache-sling-scripting-core/pull/33#discussion_r2731223862


##########
src/main/java/org/apache/sling/scripting/core/impl/bundled/ScriptContextProvider.java:
##########
@@ -104,17 +104,19 @@ public ExecutableContext prepareScriptContext(
                         executable.getScriptEngineName(), 
executable.getScriptExtension(), executable.getPath()));
             }
         }
-        // prepare the SlingBindings
-        Bindings bindings = new LazyBindings();
+        // prepare the bindings; use SlingBindings to ensure that the 
REQUEST/RESPONSE and
+        // JAKARTA_REQUEST/JAKARTA_RESPONSE values are kept in sync
+        Bindings bindings = new SlingBindings();
         bindings.put("properties", (LazyBindings.Supplier)
-                () -> scriptHelper.getRequest().getResource().getValueMap());
-        bindings.put(SlingBindings.REQUEST, scriptHelper.getRequest());
-        bindings.put(SlingBindings.RESPONSE, scriptHelper.getResponse());

Review Comment:
   This is a change in behavior and it might break scripts relying on those two 
values.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to