Closed janheise closed 3 years ago
I can reproduce that. This would fix it, not sure if that's the right way, though. :wink: /cc @dennisoelkers @kmerz @linuspahl
diff --git graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx
index 4619780dac..36b05087b8 100644
--- graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx
+++ graylog2-web-interface/src/components/content-packs/ContentPackDownloadControl.jsx
@@ -42,11 +42,15 @@ class ContentPackDownloadControl extends React.Component {
_getDownloadUrl() {
const { contentPackId, revision } = this.props;
- const url = new URI(URLUtils.qualifyUrl(
+ let url = new URI(URLUtils.qualifyUrl(
ApiRoutes.ContentPacksController.downloadRev(contentPackId, revision).url,
));
if (URLUtils.areCredentialsInURLSupported()) {
+ // If we set username and password for a relative URL, we get a broken link. (e.g. "username:password@/api/...")
+ if (url.is('relative')) {
+ url = url.absoluteTo(location.href);
+ }
url
.username(SessionStore.getSessionId())
.password('session');
Expected Behavior
When you select "more actions"->"download" next to a ContentPack, you should be able to download the JSON using the "Save link as" option from the context menu on the link in the popup.
Current Behavior
"Save link as" does not work during development.
Steps to Reproduce (for bugs)
Context
As a developer, this is needed to check download/installation of ContentPacks
Your Environment