yuzutech / kroki

Creates diagrams from textual descriptions!
https://kroki.io
MIT License
2.83k stars 211 forks source link

Make the max URI length configurable on Vert.x (using configuration) #555

Closed mariotoffia closed 3 years ago

mariotoffia commented 3 years ago

Hi and thanks for this great piece of software! :)

I'm using excalidraw via asciidoc-kroki (from @Mogztter) - It seems that if the file gets to big or too many objects in the drawing it will fail to render the svg image. Attached both JSON files respective images of failing and the one working.

This works: image

This (from excalidraw.com) do not work: image

json-files.zip

Cheers, Mario :)

ggrossetie commented 3 years ago

I'm using excalidraw via asciidoc-kroki (from @Mogztter) - It seems that if the file gets to big or too many objects in the drawing it will fail to render the svg image. Attached both JSON files respective images of failing and the one working.

The public instance of Kroki returns a "414 Request-URI Too Large" when the URI exceeds 4K bytes. It ensures that the public instance will run smoothly. Please note that you can configure a higher value if you are self-hosting Kroki.

In this case, the Asciidoctor Kroki extension should use a POST request but I think the limit should be 4000 and not 4096.

https://github.com/Mogztter/asciidoctor-kroki/blob/35f75e232a5671fe4e404a9b6e4516e011b5919e/src/kroki-client.js#L26

I will transfer this issue since it's not related to Kroki (or at least Kroki is working as expected).

ggrossetie commented 3 years ago

I will transfer this issue since it's not related to Kroki (or at least Kroki is working as expected).

Actually I cannot transfer an issue from another organization :disappointed: Could you please open a new issue at: https://github.com/mogztter/asciidoctor-kroki?

mariotoffia commented 3 years ago

Thanks @Mogztter - I'll create a new issue at asciidoctor-kroki!

ggrossetie commented 3 years ago

Currently, this value is not configurable. For reference, we could update the value using https://vertx.io/docs/apidocs/io/vertx/core/http/HttpServerOptions.html#setMaxInitialLineLength-int-.

It would allow to increase the default value (4096) on self-hosted instance.

lind commented 3 years ago

A proposal for this issue in https://github.com/yuzutech/kroki/pull/626

ggrossetie commented 3 years ago

fixed in 7c0664e