The Gemini Protocol makes it clear that the maximum length of a URI, when making a request, is 1024 bytes. This has implications for how large a user's input can be when responding to a 1x response. Because of this, I'd like to update Rogallo so that it lets the user know how much space they have left as they type in their input.
With this in mind I've released v0.7.0 of Wasat. This adds the following to GeminiURI:
GeminiURI.MAXIMUM_LENGTH-- a constant for the maximum length of a Gemini URI (as mentioned above: 1024).len()support -- if you ask for thelenof an instance ofGeminiURIit will return the length of the full URI.GeminiURI.bytes_leftis a property that tells you how many bytes are left until the limit, given the current URI.GeminiURI.too_longis a boolean property that flags if the current URI is too long to send to a Gemini capsule.
This should give me all I need to add some guardrails to the user input dialog in Rogallo.
Have a comment or query about this post? Feel free to drop me a line about it.