- Notifications
You must be signed in to change notification settings - Fork20.6k
Tests: Recognize callbacks with dots in the Node.js mock server#4764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This is usually recommended against because it allows things like However, for the local mock proxy that seems fine 👍 |
We're going to check why the filename is used as the callback name. |
Uh oh!
There was an error while loading.Please reload this page.
This aligns the Node.js server with the previous PHP one in accepting `mock.php`as a callback which is triggered by a recently added test. This prevents therequest crashing on that Node.js server and printing a JS error:```TypeError: Cannot read property '1' of null```Refjquerygh-4754
mgol commentedSep 2, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@timmywil@Krinkle I've just had another look. Code I'm changing doesn't check the query parameter but a REST-like path. Since we only serve it as On the other hand, we do not validate the callback parameter value in any way either in the PHP server or in the Node.js one, e.g. the following URL: document.body.innerHTML=({"data":{"lang":"en","length":25}}) Therefore, this PR should be safe to land as-is; we can address callback validation separately if needed. But, since this was the behavior for ages, this shouldn't be a huge issue in practice... |
This aligns the Node.js server with the previous PHP one in sending `mock.php`as a callback if there's no `callback` parameter in the query string which istriggered by a recently added test. This prevents the request crashing on thatNode.js server and printing a JS error:```TypeError: Cannot read property '1' of null```Closesjquerygh-4764Refjquerygh-4754(cherry picked from commitdf6858d)
Only allow alphanumeric characters & underscores for callback parameters.The change is done both for the PHP server as well as the Node.js-based version.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.Refjquerygh-4764
Only allow alphanumeric characters & underscores for callback parameters.The change is done both for the PHP server as well as the Node.js-based version.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.Refgh-4764Closesgh-4871
Only allow alphanumeric characters & underscores for callback parameters.The change is done both for the PHP server as well as the Node.js-based version.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.Refgh-4764Closesgh-4871(cherry picked froma702746)
Only allow alphanumeric characters & underscores for callback parameters.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.This is a 1.x/2.x version of pRjquerygh-4871Refjquerygh-4764Refjquerygh-4871
Only allow alphanumeric characters & underscores for callback parameters.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.This is a 1.x/2.x version of PRjquerygh-4871.The change doesn't require a release; it's meant at installations testingthe latest state of `1.12-stable` & `2.2-stable` branches.Refjquerygh-4764Refjquerygh-4871
Only allow alphanumeric characters & underscores for callback parameters.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.This is a 1.x/2.x version of PRjquerygh-4871.The change doesn't require a release; it's meant at installations testingthe latest state of `1.12-stable` & `2.2-stable` branches.This change also fixes testing on Travis & on Chrome/Firefox.Refjquerygh-4764Refjquerygh-4871
Only allow alphanumeric characters & underscores for callback parameters.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.This is a 1.x/2.x version of PRgh-4871.The change doesn't require a release; it's meant at installations testingthe latest state of `1.12-stable` & `2.2-stable` branches.This change also fixes testing on Travis & on Chrome/Firefox.Closesgh-4875Refgh-4764Refgh-4871
Only allow alphanumeric characters & underscores for callback parameters.This is only test code so we're not fixing any security issue but it happensoften enough that the whole jQuery repository directory structure is deployedonto the server with PHP enabled that it makes is easy to introduce securityissues if this cleanup is not done.This is a 1.x/2.x version of PRjquerygh-4871.The change doesn't require a release; it's meant at installations testingthe latest state of `1.12-stable` & `2.2-stable` branches.This change also fixes testing on Travis & on Chrome/Firefox.Closesjquerygh-4875Refjquerygh-4764Refjquerygh-4871(cherry picked fromacb7c49)
Uh oh!
There was an error while loading.Please reload this page.
Summary
This aligns the Node.js server with the previous PHP one in sending
mock.php
as a callback if there's no
callback
parameter in the query string which istriggered by a recently added test. This prevents the request crashing on that
Node.js server and printing a JS error:
Refgh-4754
Checklist
New tests have been added to show the fix or feature worksIf needed, a docs issue/PR was created athttps://github.com/jquery/api.jquery.com