Skip to content

Commit

Permalink
Merge pull request #21 from fukamachi/fix/utf-8-content-length
Browse files Browse the repository at this point in the history
Fix the wrong Content-Length for UTF-8 response bodies.
  • Loading branch information
jbouwman authored Jan 14, 2025
2 parents 65787ad + 3f84a64 commit 6cb0b62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ following Lisp libraries:
- bordeaux-threads
- com.inuoe.jzon
- usocket
- trivial-utf-8

## Current Status

Expand Down
3 changes: 2 additions & 1 deletion coalton-lsp.asd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#:bordeaux-threads
#:coalton
#:com.inuoe.jzon
#:usocket)
#:usocket
#:trivial-utf-8)
:pathname "src/"
:serial t
:components ((:file "package")
Expand Down
2 changes: 1 addition & 1 deletion src/lib/rpc.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
(defun %write-rpc (message stream)
(let ((content (message-content message)))
(write-headers stream
`(("Content-Length" . ,(length content))
`(("Content-Length" . ,(trivial-utf-8:utf-8-byte-length content))
("Content-Type" . "application/json-rpc")))
(write-sequence content stream)
(force-output stream)))
Expand Down

0 comments on commit 6cb0b62

Please sign in to comment.