vscode-plantuml
vscode-plantuml copied to clipboard
Getting "Error: 414 URI Too Long" until restart of vscode
I am having an issue of inconsistent behavior of the plantuml extension.
I have plantuml files with both a URL include and local includes. (See below). The files render the first 2 times when selected in the vscode explorer. However, after the third or fourth time selecting the files. I get Error: 414 URI Too Long
(see below) and I have to restart vscode in order to render these files again.
These are my environment details:
OS: Windows 10
vscode: v1.56.1
plantuml extension: v2.14.5
PlantUML server: Docker image plantuml/plantuml-server:jetty-v1.2021.5
Based on the resolution of this issue https://github.com/qjebbs/vscode-plantuml/issues/260, I believe that the plugin supports POST requests to a local plantuml server with include support. But it seems it is using GET request instead at the time the error occurs.
Is there a way to see the extension logs to investigate further?
@startuml File 1
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml
!include ../../lib/container.puml
!include common.puml
' elements here
@enduml
@startuml File 2
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml
!include ../../lib/container.puml
!include common.puml
' elements here
@enduml
Error: 414 URI Too Long
GET http://localhost:8080/svg/0/...
at ClientRequest.closeCallback (c:\Users\faceydp\.vscode\extensions\jebbs.plantuml-2.14.5\out\src\plantuml\renders\httpWrapper.js:77:27)
at ClientRequest.emit (events.js:315:20)
at Socket.socketCloseListener (_http_client.js:428:9)
at Socket.emit (events.js:327:22)
at TCP. (net.js:673:12)
There's something we can do to improve in this case.
Currently,
if the server fails to response to POST
one time, falls back to GET
for good (where Error: 414 URI Too Long
comes from)
Should change to,
If the server response to POST
well at the first time, stick to use POST
and ignore errors
PR is welcome.
@qjebbs are you willing to accept an PR which fits your comment? Would also be interested in this and i could image contributing 👍