Skip to content
This repository was archived by the owner on May 28, 2022. It is now read-only.
This repository was archived by the owner on May 28, 2022. It is now read-only.

make_index breaks relative links #10

@asomers

Description

@asomers

If make_index detects that the browser left off the final "index.html", for example when requesting "http://MYHOST:4000/MYCRATE", it will append "/index.html" when it looks for the file on disk. The returned response's body will look correct. However, all relative links will be formatted wrong. If the user clicks on one, he'll be directed to a nonexistent URL. For example:

  1. If I browse to http://MYHOST:4000/nix, I'll see the familiar doc index for the nix crate
  2. But if I click on a href="fcntl/index.html link, the browser actually interprets it as http://MYHOST:4000/fcntl/index.html, which does not exist.

The correct solution, when the user requests a directory URI instead of a file, would be to return a 302 redirect pointing to the index.html file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions