Allow use of other index extensions (htm, xhtml, etc)
Context:
We must use index.html filename in the public directory to display GitLab Pages. As the
documentation states:
404 error when accessing a GitLab Pages site URL
This problem most likely results from a missing index.html file in the public directory. If after deploying a Pages site a 404 is encountered, confirm that the public directory contains an index.html file. If the file contains a different name such as test.html, the Pages site can still be accessed, but the full path would be needed. For example: https//group-name.pages.example.com/project-name/test.html.
This means if we use as a filename index.htm, this will return a 404 error and you need to use the full path to access your pages https//group-name.pages.example.com/project-name/index.htm.
Proposal
Also look for an index.htm in the public directory, so we can use index.htm or index.html to display our GitLab Pages.
Implementation guide
- When we read the zip archive, we make a list of directories/files in that archive
- At this point, we should check what is the extension of
indexfile. Save that extension in a field(fileExtension) for that archive which will default tohtml. - Optional : We can add a check here to see if it's from an allowed list of extension(and can then parameterize that flag as well in future)
- Instead of hardcoding the extension in places like these, use the saved extension from the above step.
List of allowed extensions:
- html
- xhtml
- htm
- xhtm
Edited by Kassio Borges