Internal Pages API: Source path should not have trailing "/"
When we built the internal Pages API (#28781 (closed)) we suffixed the source path with /
def source
{
type: 'file',
path: File.join(project.full_path, 'public/')
}
end
This is different from what the legacy disk config source is doing. When using it Reader.resolvePath receives
gitlab-org/gitlab-org.127.0.0.1.xip.io/public
as value for the publicPath argument, while when using the gitlab config source it gets
gitlab-org/gitlab-org.127.0.0.1.xip.io/public/
which leads to error like
"gitlab-org/gitlab-org.127.0.0.1.xip.io/public" should be in "gitlab-org/gitlab-org.127.0.0.1.xip.io/public/"
and eventually to 404 Not Found - https://gitlab.com/gitlab-org/gitlab-pages/blob/266b942aba1f98c0548472542cfc6b7cec7a5f17/internal/serving/disk/reader.go#L71-112.
Not sure why we went with that trailing / bit looks like we need to remove it in order to match the disk source? It works fine and the pages are served when I remove it from the API response.
Edited by Krasimir Angelov