hplip tools use localhost in HTTP request when addressing printer over network
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
New
|
Undecided
|
Unassigned |
Bug Description
HPLIP 3.23.5
Printer: OfficeJet Pro 9010 All-in-one, connected on local network.
OS: Linux Mint 21.2
HPLIP tools such as hp-info send HTTP GET requests to the printer but the HTTP header contains a Host:localhost line, which is refused by the EWS of the printer. It returns 403 Forbidden.
My device URI: hp:/net/
The failing requests:
GET /DevMgmt/
Accept: text/plain
Host:localhost
User-Agent:hplip
and
GET /DevMgmt/
Accept: text/plain
Host:localhost
User-Agent:hplip
and
GET /DevMgmt/
Accept: text/plain
Host:localhost
User-Agent:hplip
The HPLIP Status service then erroneously reports the state of the printer as Busy, powered down or unplugged. No Supplies info was shown either.
I was able to correct the software for my printer by editing the /usr/share/
In essence the correction consists of replacing the fixed string 'localhost' by the value of the http_host field of the device object.
I replaced all occurrences of localhost, but I might have replaced too many of them. I leave that to you to judge.
Although the comment above the methods indicate a "hp:/usb/..." uri, these methods get also called for "hp:/net/..." uris.
Your detailed report seems to indicate a deficiency in
HPLIP. We assume you can still print and scan.
What is the connection method to the printer?