Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf6858d

Browse files
authored
Tests: Recognize callbacks with dots in the Node.js mock server
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```Closesgh-4764Refgh-4754
1 parentc18dc49 commitdf6858d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎test/middleware-mockserver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ var mocks = {
101101
}elseif(req.query.callback){
102102
callback=Promise.resolve(req.query.callback);
103103
}elseif(req.method==="GET"){
104-
callback=Promise.resolve(req.url.match(/^.+\/([^\/?.]+)\?.+$/)[1]);
104+
callback=Promise.resolve(req.url.match(/^.+\/([^\/?]+)\?.+$/)[1]);
105105
}else{
106106
callback=getBody(req).then(function(body){
107107
returnbody.trim().replace("callback=","");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp