Another little update to Wasat, this time bumping the version to v1.11.0.
After this morning's change, I made a start on the work I wanted to do on Rogallo and quickly realised that most of what I had planned was better done in Wasat itself. The short version is: rather than maintaining a just-this-session ignore list in the application, it made more sense to handle this in Wasat.
So this release adds an ignore_security_error method to the client that lets you -- for the current session -- ignore a particular type of error for a given host/port pair. This makes for a lot less work needing to be done by the application making use of Wasat. Now it's just a case of1:
from wasat import Client, IgnorableSecurityError
client = Client()
uri = "gemini://expired.example.com/"
try:
response = await client.request(uri)
except IgnorableSecurityError as error:
client.ignore_security_error(uri, error)
response = await client.request(uri)
Obviously, the code in Rogallo is a bit more involved than the above, but that's the gist of it: try the request, if it fails with an error that can be ignored, ignore it and try again.
Yes, I know the
awaitisn't going to work in this example; consider it pseudo-code. ↩
Have a comment or query about this post? Feel free to drop me a line about it.