Closed booti386 closed 3 years ago
Cc: @tillkamppeter, @michaelrsweet
Unfortunately, this problem cannot be fixed here. Under some circumstances Avahi announces localhost devices under name different from localhost
. ipp-usb
cannot control it.
Most of the printers still work in this situation, but few models are more restrictive.
Ideally, it should be fixed at the Avahi side. But experience shows that getting something fixed at Avahi is nearly hopeless. Alternatively, workaround could be added to CUPS to always set Host: localhost:port
, if printer's address is 127.0.0.1
or ::1
, regardless of printer's host name, obtained from Avahi
I tried to fix it by creating a quirk for ipp-usb (http-host = localhost:6000
), but it didn't work and the header value remained the same in the logs.
I also tried with http-text = bla
, to make sure I didn't messed up, and this time the test header properly showed up in the logs.
I suspect it's because the http backend overwrites automagically the host field by default, but couldn't it be useful to add the ability to override it anyway using quirks?
Ideally, it should be fixed at the Avahi side. But experience shows that getting something fixed at Avahi is nearly hopeless. Alternatively, workaround could be added to CUPS to always set
Host: localhost:port
, if printer's address is127.0.0.1
or::1
, regardless of printer's host name, obtained from Avahi
@alexpevzner please report an issue on CUPS.
@booti386,
this issue cannot be fixed as in #30. The problem is that responses to some IPP requests may contains URLs, and because in the IPP over USB case device has no idea regardless its hostname, it simply mirrors hostname from the Host:
header of request.
If we override the Host:
reader in request, URLs response will point to different domain that request was sent to. It may cause unobvious problems.
I see, quite a dumb problem I'm not sure it should prevent this patch to be merged tho (removed the reference to this issue), as any header should be overridable anyway
ipp-usb
allocates TCP ports dynamically, so in any case, Host:
cannot be overriden with a constant string.
I would like to understand something, tho. The printer answers with HTTP 400 Bad Request to each request that does not have 127.0.0.1: or localhost: as Host Then how sharing this printer over the LAN is supposed to work, unless ipp-usb patches request (=> localhost) and answers (=> back to origin) on the fly?
Then how sharing this printer over the LAN is supposed to work
For this particular printer, only via CUPS.
My current position: ipp-usb
should not attempt to modify or somehow "improve" the content of HTTP "messages" passed through it. All modifications of HTTP requests it performs doesn't change semantics of these requests and affects only transport-level handling of them.
My reasons are following:
ipp-usb
: IPP printing, eSCL scanning, web consoleThank you for your detailed answer, I understand the whole picture better. I'm closing the issue as it cannot be fixed in ipp-usb.
... that has not the Host header set to either localhost:[port] or 127.0.0.1:[port]
Examples of success:
Examples of failure:
For information: