Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

people: Use `location.origin` instead of just `location`.

Lalit5140b76f7165
diff --git a/web/src/people.js b/web/src/people.js
index ee24c29fa9f..b8f6b71d15a 100644
--- a/web/src/people.js
+++ b/web/src/people.js
@@ -655,7 +655,7 @@ export function exclude_me_from_string(user_ids_string) {
}
export function format_small_avatar_url(raw_url) {
- const url = new URL(raw_url, location);
+ const url = new URL(raw_url, location.origin);
url.search += (url.search ? "&" : "") + "s=50";
return url.href;
}
@@ -723,7 +723,7 @@ export function small_avatar_url_for_person(person) {
function medium_gravatar_url_for_email(email) {
const hash = md5(email.toLowerCase());
const avatar_url = "https://secure.gravatar.com/avatar/" + hash + "?d=identicon";
- const url = new URL(avatar_url, location);
+ const url = new URL(avatar_url, location.origin);
url.search += (url.search ? "&" : "") + "s=500";
return url.href;
}