mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
- improve docu for "setHeader" method
- add test case for "setHeader" call with port number
This commit is contained in:
+20
-1
@@ -58,7 +58,7 @@ describe('Advanced HTTP www interface', function() {
|
||||
http.get('url', {}, {}, noop, noop);
|
||||
});
|
||||
|
||||
it('resolves host headers correctly', () => {
|
||||
it('resolves host headers correctly (set without port number)', () => {
|
||||
mock(`${PLUGIN_ID}.cookie-handler`, {
|
||||
getCookieString: () => 'fakeCookieString'
|
||||
});
|
||||
@@ -77,6 +77,25 @@ describe('Advanced HTTP www interface', function() {
|
||||
http.get('https://www.google.de/?gws_rd=ssl', {}, {}, noop, noop);
|
||||
});
|
||||
|
||||
it('resolves host headers correctly (set with port number)', () => {
|
||||
mock(`${PLUGIN_ID}.cookie-handler`, {
|
||||
getCookieString: () => 'fakeCookieString'
|
||||
});
|
||||
|
||||
mock('cordova/exec', (onSuccess, onFail, namespace, method, params) => {
|
||||
const headers = params[2];
|
||||
headers.should.eql({
|
||||
Cookie: 'fakeCookieString',
|
||||
myKey: 'myValue'
|
||||
});
|
||||
});
|
||||
|
||||
loadHttp();
|
||||
|
||||
http.setHeader('www.google.de:8080', 'myKey', 'myValue');
|
||||
http.get('https://www.google.de:8080/?gws_rd=ssl', {}, {}, noop, noop);
|
||||
});
|
||||
|
||||
it('resolves request headers correctly', () => {
|
||||
mock(`${PLUGIN_ID}.cookie-handler`, {
|
||||
getCookieString: () => 'fakeCookieString'
|
||||
|
||||
Reference in New Issue
Block a user