Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsonResponse -- "application/json" #67

Closed
UNIcodeX opened this issue Sep 25, 2020 · 2 comments
Closed

jsonResponse -- "application/json" #67

UNIcodeX opened this issue Sep 25, 2020 · 2 comments

Comments

@UNIcodeX
Copy link
Contributor

Why does the code in prologue/core/response refer to ## Content-Type: application/json, but then actually return a Content-Type of text/json?

func jsonResponse*(text: JsonNode, code = Http200, headers = newHttpHeaders(),
                   version = HttpVer11): Response {.inline.} =
  ## Content-Type: application/json.
  result = initResponse(version, code, headers, body = $text)
  if unlikely(result.headers == nil):
    result.headers = newHttpHeaders()
  result.headers["Content-Type"] = "text/json"
@ringabout
Copy link
Member

ringabout commented Sep 26, 2020

It should be application/json. I made a mistake. Thanks for reporting this issue. Feel free to make a pr.

@UNIcodeX
Copy link
Contributor Author

done. #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants