Closed hohwille closed 1 year ago
It seems the download filename actually is something like EclipseFormatter-23.1.223.000.0-Eclipse_2023-03.zip
what I can see when I manually download the file in the browser.
However, the curl
command to get this filename is this one:
https://github.com/devonfw/ide/blob/b238ee1138b9319db138bf0b24b5d363475f5e98/scripts/src/main/resources/scripts/command/intellij#L85
Maybe this once worked but to me it seems broken:
$ curl -sI https://plugins.jetbrains.com/pluginManager?action=download\&id=EclipseCodeFormatter\&build=IU-231.8109.175
HTTP/1.1 301 Moved Permanently
Content-Length: 0
Connection: keep-alive
Date: Fri, 14 Apr 2023 14:57:38 GMT
Location: https://plugins.jetbrains.com/files/6546/319098/EclipseFormatter-23.1.223.000.0-Eclipse_2023-03.zip?updateId=319098&pluginId=6546&family=INTELLIJ&code=IU&build=231.8109.175
X-Cache: Miss from cloudfront
Via: 1.1 8ad073ef904d92431b3428f3430707ae.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: DUS51-C1
X-Amz-Cf-Id: 7iZIav1z7Ra0lZ16_exCKN_LH_eUtdi7ouXoC8uR6AC8Sfy-MyJeig==
So to me it seems that the HTTP header is now Location
with capital L
while the code expects a lower case l
.
Typically all header names are Capitalized but if this ever worked before it is because this has changed.
After all it is kind of pointless to perform this extra HTTP request just to get a filename.
We can also use unzip
to determine if the file is in ZIP format or not...
I have a project using
devonfw-ide
withintellij
that needs specific plugins pre-installed for IntelliJ. Here I noticed that this feature got broken or never worked at all (see issue #453 and PR #600). In the logs I see this:If you read carefully you can see that 3 plugins should have been installed and have been downloaded. However
cp
andrm
commands failed all 3 times. I checked my Download directory and found such files with rather odd filenames likepluginManageraction=download&id=org.mapstruct.intellij&build=IU-231.8109.175
. I guess that windows or the shell does have problems with the special characters in the file name... The according code can be found here: https://github.com/devonfw/ide/blob/b238ee1138b9319db138bf0b24b5d363475f5e98/scripts/src/main/resources/scripts/command/intellij#L84-L88As you can see it already tries to avoid special characters like
?
or/
in the filename. However, it does not handle&
or=
further there is a non printable Unicode character in the filename. IMHO the entire approach to rely on the server side URL path filename is not sane. We already provide a constructed name as argument"intellij-plugin-${intellij_build}-${pluginId}"
so why dont we just use this as filename as well?