Skip to content

Commit

Permalink
fix(ios): instead of ignoring call give error in case of nil url pass…
Browse files Browse the repository at this point in the history
…ed to Ti.Network.HTTPClient (#11513)

* fix(ios): allow nil url to paas to request

* test : added test case for invalid url

Co-authored-by: Christopher Williams <chris.a.williams@gmail.com>
Co-authored-by: ssekhri <ssekhri@axway.com>
  • Loading branch information
3 people committed Jul 7, 2020
1 parent d7f863b commit 7630868
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
26 changes: 26 additions & 0 deletions tests/Resources/ti.network.httpclient.addontest.js
@@ -0,0 +1,26 @@
/*
* Appcelerator Titanium Mobile
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/* eslint-env mocha */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions');

describe('Titanium.Network.HTTPClient', function () {
this.timeout(6e4);

it('TIMOB-27767 - trigger error callback for invalid URL', function (finish) {
var xhr = Ti.Network.createHTTPClient();
xhr.setTimeout(6e4);

xhr.onerror = function (e) {
finish();
};

xhr.open('GET', 'https://www.google .com/'); // URL with space
xhr.send();
});
});

0 comments on commit 7630868

Please sign in to comment.