mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
DEV: Move Discourse.getURL
and related functions to a module (#9966)
* DEV: Move `Discourse.getURL` and related functions to a module * DEV: Remove `Discourse.getURL` and `Discourse.getURLWithCDN` * FIX: `get-url` is required for server side code * DEV: Deprecate `BaseUri` too.
This commit is contained in:
@ -6,6 +6,7 @@ import Controller, { inject as controller } from "@ember/controller";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { extractDomainFromUrl } from "discourse/lib/utilities";
|
||||
import EmberObject from "@ember/object";
|
||||
import { isAbsoluteURL } from "discourse-common/lib/get-url";
|
||||
|
||||
export default Controller.extend({
|
||||
adminWebHooks: controller(),
|
||||
@ -109,7 +110,7 @@ export default Controller.extend({
|
||||
domain === "localhost" ||
|
||||
domain.match(/192\.168\.\d+\.\d+/) ||
|
||||
domain.match(/127\.\d+\.\d+\.\d+/) ||
|
||||
url.startsWith(Discourse.BaseUrl)
|
||||
isAbsoluteURL(url)
|
||||
) {
|
||||
return bootbox.confirm(
|
||||
I18n.t("admin.web_hooks.warn_local_payload_url"),
|
||||
|
Reference in New Issue
Block a user