Fix http mount issues

This commit is contained in:
Ben Sarmiento
2024-01-09 00:24:53 +01:00
parent 6c4c73a5b0
commit eb3f2785ce
4 changed files with 36 additions and 9 deletions

View File

@@ -21,8 +21,9 @@ type RootResponse struct {
Version string `json:"version"`
BuiltAt string `json:"built_at"`
GitCommit string `json:"git_commit"`
Dav string `json:"dav"`
Html string `json:"html"`
Dav string `json:"dav"`
Infuse string `json:"infuse"`
Logs string `json:"logs"`
UserInfo *realdebrid.User `json:"user_info"` // Replace UserInfoType with the actual type
MemAlloc uint64 `json:"mem_alloc"` // Memory allocation in MB
@@ -48,8 +49,9 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
Version: version.GetVersion(),
BuiltAt: version.GetBuiltAt(),
GitCommit: version.GetGitCommit(),
Dav: fmt.Sprintf("//%s/dav/", req.Host),
Html: fmt.Sprintf("//%s/http/", req.Host),
Dav: fmt.Sprintf("//%s/dav/", req.Host),
Infuse: fmt.Sprintf("//%s/infuse/", req.Host),
Logs: fmt.Sprintf("//%s/logs/", req.Host),
UserInfo: userInfo,
MemAlloc: bToMb(mem.Alloc),
@@ -81,12 +83,16 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
<td>Git Commit</td>
<td colspan="2">%s</td>
</tr>
<tr>
<td>HTML</td>
<td colspan="2"><a href="%s">%s</a></td>
</tr>
<tr>
<td>DAV</td>
<td colspan="2"><a href="%s">%s</a></td>
</tr>
<tr>
<td>HTML</td>
<td>Infuse</td>
<td colspan="2"><a href="%s">%s</a></td>
</tr>
<tr>
@@ -238,10 +244,12 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
response.Version,
response.BuiltAt,
response.GitCommit,
response.Dav,
response.Dav,
response.Html,
response.Html,
response.Dav,
response.Dav,
response.Infuse,
response.Infuse,
response.Logs,
response.Logs,
response.MemAlloc,