fix(http): add 'legacy' as valid option to setSSLCertMode (#2913)

* Add 'legacy' as valid option to setSSLCertMode

Fixes #2912

* Add 'legacy' to params for setSSLCertMode

* Update index.ts
This commit is contained in:
Keith D. Moore 2019-02-14 02:46:07 -06:00 committed by Daniel Sogl
parent 959a9135e4
commit e1a490357d

View File

@ -77,10 +77,7 @@ export class HTTP extends IonicNativePlugin {
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64EncodedUsernameAndPassword'} * @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64EncodedUsernameAndPassword'}
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
getBasicAuthHeader( getBasicAuthHeader(username: string, password: string): { Authorization: string } {
username: string,
password: string
): { Authorization: string } {
return; return;
} }
@ -177,13 +174,14 @@ export class HTTP extends IonicNativePlugin {
/** /**
* Set SSL Cert handling mode, being one of the following values * Set SSL Cert handling mode, being one of the following values
* default: default SSL cert handling using system's CA certs * default: default SSL cert handling using system's CA certs
* legacy: use legacy default behavior (< 2.0.3), excluding user installed CA certs (only for Android)
* nocheck: disable SSL cert checking, trusting all certs (meant to be used only for testing purposes) * nocheck: disable SSL cert checking, trusting all certs (meant to be used only for testing purposes)
* pinned: trust only provided certs * pinned: trust only provided certs
* @see https://github.com/silkimen/cordova-plugin-advanced-http#setsslcertmode * @see https://github.com/silkimen/cordova-plugin-advanced-http#setsslcertmode
* @param {'default' | 'nocheck' | 'pinned'} mode SSL Cert handling mode * @param {'default' | 'legacy' | 'nocheck' | 'pinned'} mode SSL Cert handling mode
*/ */
@Cordova() @Cordova()
setSSLCertMode(mode: 'default' | 'nocheck' | 'pinned'): Promise<void> { setSSLCertMode(mode: 'default' | 'legacy' | 'nocheck' | 'pinned'): Promise<void> {
return; return;
} }
@ -279,13 +277,7 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure * @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
*/ */
@Cordova() @Cordova()
uploadFile( uploadFile(url: string, body: any, headers: any, filePath: string, name: string): Promise<any> {
url: string,
body: any,
headers: any,
filePath: string,
name: string
): Promise<any> {
return; return;
} }
@ -298,12 +290,7 @@ export class HTTP extends IonicNativePlugin {
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure * @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
*/ */
@Cordova() @Cordova()
downloadFile( downloadFile(url: string, body: any, headers: any, filePath: string): Promise<any> {
url: string,
body: any,
headers: any,
filePath: string
): Promise<any> {
return; return;
} }
} }