fix(api): set content type for json (#441)

This commit is contained in:
Adam Uhlíř 2023-06-13 15:33:01 +02:00 committed by GitHub
parent cfe9225be1
commit 720c372be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -250,7 +250,7 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf): RestRouter =
}
}
return RestApiResponse.response($json)
return RestApiResponse.response($json, contentType="application/json")
router.api(
MethodGet,
@ -264,7 +264,7 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf): RestRouter =
return RestApiResponse.error(Http500, err.msg)
let json = %unused
return RestApiResponse.response($json)
return RestApiResponse.response($json, contentType="application/json")
router.rawApi(
MethodPost,
@ -293,7 +293,7 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf): RestRouter =
return RestApiResponse.error(Http500, err.msg)
let json = %availability
return RestApiResponse.response($json)
return RestApiResponse.response($json, contentType="application/json")
router.api(
MethodGet,
@ -311,7 +311,7 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf): RestRouter =
let json = %purchase
return RestApiResponse.response($json)
return RestApiResponse.response($json, contentType="application/json")
return router