Skip to content
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

[Bug] [Browser] requests not working correctly because request options are not processed correctly #438

Closed
silkimen opened this issue Oct 14, 2021 · 1 comment
Labels

Comments

@silkimen
Copy link
Owner

Requests are not working correctly because request options are not processed correctly. The offset is off by one, because second timeout parameter is not implemented here.

// line 177ff. in public-interface.js
helpers.processData(options.data, options.serializer, function (data) {
  exec(onSuccess, onFail, 'CordovaHttpPlugin', options.method, [url, data, options.serializer, headers, options.connectTimeout, options.readTimeout, options.followRedirect, options.responseType, reqId]);
});

// maps to following cordova proxy implementation line 154ff. in cordova-http-plugin.js 
var data, serializer, headers, timeout, followRedirect, responseType, reqId;
var url = opts[0];

if (withData) {
  data = opts[1];
  serializer = opts[2];
  headers = opts[3];
  timeout = opts[4]; // should be connectTimeout
  followRedirect = opts[5]; // following offsets are wrong because readTimeout is missing here
  responseType = opts[6];
  reqId = opts[7];
} else {
  headers = opts[1];
  timeout = opts[2]; // see above
  followRedirect = opts[3];
  responseType = opts[4];
  reqId = opts[5];
}
@silkimen
Copy link
Owner Author

Will be fixed in v3.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant