diff --git a/docs/swagger.yaml b/docs/swagger.yaml index a915e3084..d516872b4 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1309,41 +1309,7 @@ paths: 403: description: User does not have permission of admin role. 500: - description: Unexpected internal errors. - /systeminfo/volumes: - get: - summary: Get system volume info (total/free size). - description: | - This endpoint is for retrieving system volume info that only provides for admin user. - tags: - - Products - responses: - 200: - description: Get system volumes successfully. - 401: - description: User need to log in first. - 403: - description: User does not have permission of admin role. - 500: - description: Unexpected internal errors. - /systeminfo/getcert: - get: - summary: Get default root certificate under OVA deployment. - description: | - This endpoint is for downloading a default root certificate that only provides for admin user under OVA deployment. - tags: - - Products - responses: - 200: - description: Get default root certificate successfully. - 401: - description: User need to log in first. - 403: - description: User does not have permission of admin role. - 404: - description: Not found the default root certificate. - 500: - description: Unexpected internal errors. + description: Unexpected internal errors. definitions: Search: type: object @@ -1775,22 +1741,3 @@ definitions: comment: type: string description: The new comment. - Storage: - type: object - properties: - total: - type: integer - format: int64 - description: Total volume size. - free: - type: integer - format: int64 - description: Free volume size. - SystemInfo: - type: object - properties: - storage: - type: array - description: The storage of system. - items: - $ref: '#/definitions/Storage' \ No newline at end of file diff --git a/src/ui/api/systeminfo.go b/src/ui/api/systeminfo.go index 8afedc00f..0310409e2 100644 --- a/src/ui/api/systeminfo.go +++ b/src/ui/api/systeminfo.go @@ -73,7 +73,6 @@ func (sia *SystemInfoAPI) GetVolumeInfo() { func (sia *SystemInfoAPI) GetCert() { if sia.isAdmin { if _, err := os.Stat(defaultRootCert); !os.IsNotExist(err) { - sia.Ctx.Output.Header("Content-Type", "application/octet-stream") sia.Ctx.Output.Header("Content-Disposition", "attachment; filename=ca.crt") http.ServeFile(sia.Ctx.ResponseWriter, sia.Ctx.Request, defaultRootCert) } else { @@ -81,5 +80,5 @@ func (sia *SystemInfoAPI) GetCert() { sia.CustomAbort(http.StatusNotFound, "No certificate found.") } } - sia.CustomAbort(http.StatusForbidden, "") + sia.CustomAbort(http.StatusUnauthorized, "") }