Wyn-Price / CurseMaven

A more robust alternative to the CurseForge maven.
https://www.cursemaven.com/
21 stars 5 forks source link

Allow to query files with zip extension #3

Closed noeppi-noeppi closed 2 years ago

noeppi-noeppi commented 2 years ago

This is useful do download modpack files through CurseMaven. Currently, this is possible but only if .jar is used as the extension. I think allowing .zip as extension is a cleaner solution.

Wyn-Price commented 2 years ago

Is there a reason to download modpack files through cursemaven? I also can't imagine needing classifierjar for zip files.

I don't mind zip files being downloaded, but if they're not going to be downloaded via gradle, I'd like to handle them separately as I can just return a normal 304

noeppi-noeppi commented 2 years ago

Is there a reason to download modpack files through cursemaven?

Yes, it works reliably

I also can't imagine needing classifierjar for zip files.

Now that I think about it, yes it is probably not needed, I'll remove it.

I don't mind zip files being downloaded, but if they're not going to be downloaded via gradle, I'd like to handle them separately as I can just return a normal 304

My use case is a gradle plugin that adds all mod files from a modpack to a configuration. So that means the modpack zip would be downloaded by gradle.

Wyn-Price commented 2 years ago

My use case is a gradle plugin that adds all mod files from a modpack to a configuration. So that means the modpack zip would be downloaded by gradle.

Could you link to the gradle plugin? I don't think it would be downloaded by gradle but instead downloaded by the gradle plugin. The reason I have to handle 304s weirdly is due to the gradle maven artifact downloader not handling redirects with a + in the url properly.

noeppi-noeppi commented 2 years ago

It uses MavenArtifactDownloader from ForgeGradle.

https://github.com/noeppi-noeppi/ModGradle/blob/v1/plugin/src/main/java/io/github/noeppi_noeppi/tools/modgradle/plugins/cursedep/CurseDependencyExtension.java#L66

Wyn-Price commented 2 years ago

From what I can tell here, it should be okay to just return a 304, and not have to worry about proxying invalid jars. I'll add this now then.