Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New logic for generating HTTP-redirects
Before this fix the root URL for a book was assumed to resolve to the main page. This was not true for ZIM files containing an entry at an empty path or with a path equal to "/", resulting in issue #826. The logic behind this behaviour is found in `kiwix::getEntryFromPath()`. The fix to that issue is a little more general and will result in an HTTP redirect in any case where `kiwix::getEntryFromPath(zim, path)` returns an entry with a real path different from the requested one. In particular, this will affect the behaviour on ZIM files with the old namespace scheme, where the requested resource - if not found - is also looked up in the 'A', 'I', 'J', and/or '-' namespaces. Now instead of returning the contents of that other resource an HTTP redirect response will be sent.
- Loading branch information