iftechfoundation / ifarchive-unbox

IF Archive Unboxing service
https://unbox.ifarchive.org
MIT License
1 stars 2 forks source link

Error with symlinks #12

Closed dfabulich closed 2 years ago

dfabulich commented 2 years ago

https://ifarchive.org/if-archive/games/mini-comps/spanish/retrocomp2004/orfeo2.zip exists

but https://unbox.ifarchive.org/?url=https%3A%2F%2Fifarchive.org%2Fif-archive%2Fgames%2Fmini-comps%2Fspanish%2Fretrocomp2004%2Forfeo2.zip shows an error:

BadRequestError: Unknown file: https://ifarchive.org/if-archive/games/mini-comps/spanish/retrocomp2004/orfeo2.zip

dfabulich commented 2 years ago

The problem is that https://ifarchive.org/if-archive/games/mini-comps/spanish/retrocomp2004/orfeo2.zip is not the canonical URL for orfeo2.zip. The canonical URL is https://ifarchive.org/if-archive/games/competitions-spanish/retrocomp2004/orfeo2.zip

That's because games/mini-comps/spanish is actually a symlink to games/competitions/spanish. Master-Index.xml explains:

<file>
<name>spanish</name>
<directory>if-archive/games/mini-comps</directory>
<path>if-archive/games/mini-comps/spanish</path>

<symlink type="dir">
<name>if-archive/games/competitions-spanish</name>
<xdir>if-archiveXgamesXcompetitions-spanish</xdir>
</symlink>

<description>
Symlink to if-archive/games/competitions-spanish
</description>
</file>