diff --git a/NOTICE.txt b/NOTICE.txt index 89e28fee4..2ff44674d 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1002,3 +1002,36 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +## url-parse + +This product contains 'url-parse.js', Small footprint URL parser that works seamlessly across Node.js and browser environments. + +* HOMEPAGE: + * https://github.com/unshiftio/url-parse + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/app/scenes/select_server/select_server.js b/app/scenes/select_server/select_server.js index 784cc2650..dfd695eab 100644 --- a/app/scenes/select_server/select_server.js +++ b/app/scenes/select_server/select_server.js @@ -25,6 +25,8 @@ import TextInputWithLocalizedPlaceholder from 'app/components/text_input_with_lo import {GlobalStyles} from 'app/styles'; import {isValidUrl, stripTrailingSlashes} from 'app/utils/url'; +import urlParse from 'url-parse'; + import logo from 'assets/images/logo.png'; export default class SelectServer extends PureComponent { @@ -77,7 +79,8 @@ export default class SelectServer extends PureComponent { }; onClick = async () => { - const url = this.props.serverUrl; + const preUrl = urlParse(this.props.serverUrl, true); + const url = preUrl.protocol + '//' + preUrl.host; let error = null; Keyboard.dismiss(); diff --git a/package.json b/package.json index 2ca79999b..d3147fecc 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,8 @@ "redux-persist-transform-filter": "0.0.9", "redux-thunk": "2.2.0", "reselect": "3.0.0", - "semver": "5.3.0" + "semver": "5.3.0", + "url-parse" : "1.1.8" }, "devDependencies": { "babel-cli": "6.24.0",