-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
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 the request crashing on that Node.js server and printing a JS error: ``` TypeError: Cannot read property '1' of null ``` Ref jquerygh-4754
446c05c to
2f1050d
Compare
|
@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 is triggered by a recently added test. This prevents the request crashing on that Node.js server and printing a JS error: ``` TypeError: Cannot read property '1' of null ``` Closes jquerygh-4764 Ref jquerygh-4754 (cherry picked from commit df6858d)
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 happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. Ref jquerygh-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 happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. Ref gh-4764 Closes gh-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 happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. Ref gh-4764 Closes gh-4871 (cherry picked from a702746)
Only allow alphanumeric characters & underscores for callback parameters. This is only test code so we're not fixing any security issue but it happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. This is a 1.x/2.x version of pR jquerygh-4871 Ref jquerygh-4764 Ref jquerygh-4871
Only allow alphanumeric characters & underscores for callback parameters. This is only test code so we're not fixing any security issue but it happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. This is a 1.x/2.x version of PR jquerygh-4871. The change doesn't require a release; it's meant at installations testing the latest state of `1.12-stable` & `2.2-stable` branches. Ref jquerygh-4764 Ref jquerygh-4871
Only allow alphanumeric characters & underscores for callback parameters. This is only test code so we're not fixing any security issue but it happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. This is a 1.x/2.x version of PR jquerygh-4871. The change doesn't require a release; it's meant at installations testing the latest state of `1.12-stable` & `2.2-stable` branches. This change also fixes testing on Travis & on Chrome/Firefox. Ref jquerygh-4764 Ref jquerygh-4871
Only allow alphanumeric characters & underscores for callback parameters. This is only test code so we're not fixing any security issue but it happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. This is a 1.x/2.x version of PR gh-4871. The change doesn't require a release; it's meant at installations testing the latest state of `1.12-stable` & `2.2-stable` branches. This change also fixes testing on Travis & on Chrome/Firefox. Closes gh-4875 Ref gh-4764 Ref gh-4871
Only allow alphanumeric characters & underscores for callback parameters. This is only test code so we're not fixing any security issue but it happens often enough that the whole jQuery repository directory structure is deployed onto the server with PHP enabled that it makes is easy to introduce security issues if this cleanup is not done. This is a 1.x/2.x version of PR jquerygh-4871. The change doesn't require a release; it's meant at installations testing the latest state of `1.12-stable` & `2.2-stable` branches. This change also fixes testing on Travis & on Chrome/Firefox. Closes jquerygh-4875 Ref jquerygh-4764 Ref jquerygh-4871 (cherry picked from acb7c49)
Summary
This aligns the Node.js server with the previous PHP one in sending
mock.phpas a callback if there's no
callbackparameter 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:
Ref gh-4754
Checklist
New tests have been added to show the fix or feature worksIf needed, a docs issue/PR was created at https://github.com/jquery/api.jquery.com