valentjn / ltex-ls

LTeX Language Server: LSP language server for LanguageTool :mag::heavy_check_mark: with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
764 stars 33 forks source link

Fix LT HTTP request Content-Type #276

Open Javier-varez opened 12 months ago

Javier-varez commented 12 months ago

The LanguageTool check endpoint actually expects an HTTP request with an "application/x-www-form-urlencoded" Content-Type. Currently ltex-ls uses the "application/json" Content-Type for the HTTP request, but this does not play well with some third-party tools that follow the same LanguageTool API like https://github.com/cpg314/ltapiserv-rs.

The official LanguageTool HTTP server does not seem to be affected by this bug.

See the API documentation: https://languagetool.org/http-api/swagger-ui/#!/default/post_check