Closed ocindev closed 1 year ago
Hi Nico, thanks for your report and pull request. How do you manage to setup a printer (in CUPS?) with queue name including a white space? I am trying to fully reproduce the issue and want to print to such a queue. The Apple CUPS of my macOS does replace " " with "_" when I setup new printers. Which IPP Server implementation do you connect to?
Hi Gerhard,
our client did setup a printer behind Microsofts Internet Printing Service based on their IIS stuff. The resulting network URI did contain the full printer name with whitespaces, e.g http://127.0.0.1/printers/HP Color LaserJet M553 PCL 6/.printer
.
Locally on my MacBook using CUPS i wasnt able to reproduce this neither. So this might be some kind ugly Microsoft Windows thing.
Short update. Just checked with a colleague. Windows indeed does NOT restrict the usage of whitespaces in network share names for printers. So this just seems to be an edge case :)
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 theIPPClients
methodtoHttpUri
using thegetPath
fromjava.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 one should use the
java.net.URI::getRawPath