mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Console] Fix bug in which loading from a remote url fails when View in Console button is clicked in Elastic docs #144003
Co-authored-by: Muhammad Ibragimov <muhammad.ibragimov@elastic.co>
This commit is contained in:
parent
2e03c3a60b
commit
b7c8011f33
1 changed files with 3 additions and 1 deletions
|
@ -115,7 +115,9 @@ function EditorUI({ initialTextValue, setEditorInstance }: EditorProps) {
|
|||
|
||||
const loadBufferFromRemote = (url: string) => {
|
||||
const coreEditor = editor.getCoreEditor();
|
||||
if (/^https?:\/\//.test(url)) {
|
||||
// Normalize and encode the URL to avoid issues with spaces and other special characters.
|
||||
const encodedUrl = new URL(url).toString();
|
||||
if (/^https?:\/\//.test(encodedUrl)) {
|
||||
const loadFrom: Record<string, any> = {
|
||||
url,
|
||||
// Having dataType here is required as it doesn't allow jQuery to `eval` content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue