Skip to content

Commit 75019c1

Browse files
authored
Merge pull request #1169 from cptran777/remove-ui-https-redirect
remove client side redirection to https
2 parents a99654f + 8060222 commit 75019c1

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

wherehows-web/app/router.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { get, getWithDefault } from '@ember/object';
33
import { inject as service } from '@ember/service';
44
import { scheduleOnce } from '@ember/runloop';
55
import config from 'wherehows-web/config/environment';
6-
import { redirectToHttps } from 'wherehows-web/utils/build-url';
76

87
const AppRouter = Router.extend({
98
location: config.locationType,
@@ -12,17 +11,6 @@ const AppRouter = Router.extend({
1211

1312
metrics: service(),
1413

15-
willTransition() {
16-
const {
17-
APP: { useSecureRedirect }
18-
} = config;
19-
this._super(...arguments);
20-
21-
if (useSecureRedirect) {
22-
redirectToHttps(window.location);
23-
}
24-
},
25-
2614
didTransition() {
2715
this._super(...arguments);
2816

wherehows-web/app/utils/build-url.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,3 @@ export default (baseUrl: string, queryParam: string, queryValue: string): string
3939

4040
return `${baseUrl}${separator}${queryParam}=${queryValue}`;
4141
};
42-
43-
/**
44-
* Sets the href on a location object if the protocol is not https
45-
* @param {Location} { protocol, href }
46-
*/
47-
export const redirectToHttps = ({ protocol, href, hostname }: Location): void => {
48-
const secureProtocol = 'https:';
49-
50-
if (protocol !== secureProtocol && hostname !== 'localhost') {
51-
window.location.replace(`${secureProtocol}${href.substring(protocol.length)}`);
52-
}
53-
};

0 commit comments

Comments
 (0)