gmuth / ipp-client-kotlin

A client implementation of the ipp protocol written in kotlin
MIT License
75 stars 10 forks source link

URISyntaxException when using printer url with URI encoded whitespaces #12

Closed ocindev closed 1 year ago

ocindev commented 1 year ago

When trying to connect to a ipp printer whose URI contains encoded whitespaces, e.g http://localhost/PDF%20Printer/.printer, the library throws an URISyntaxException when trying to sent the ipp request. This is due to the IPPClients method toHttpUri using the getPath from java.net.URI which delivers the decoded path version. As a following result the call of URI.create("$scheme://$host:$port$path") throws the afformentioned exception.

As a solution we should use the java.net.URI::getRawPath Fixes #13