https://bugs.kde.org/show_bug.cgi?id=413818

            Bug ID: 413818
           Summary: Error is 0 for KIO:: Get while
           Product: frameworks-kio
           Version: 5.62.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: HTTP
          Assignee: kdelibs-b...@kde.org
          Reporter: trufano...@gmail.com
  Target Milestone: ---

SUMMARY

I'm trying to use KIO::get(url,KIO::NoReload,KIO::HideProgressInfo)
for url that returns 403 Forbidden error from server.
My expectation was that I'll catch some errors, but in slot connected to
KIO::TransferJob::result  I'm getting job->error() == 0 and data with something
like:

<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
</body>
</html>

Also job->isErrorPage() returns true.
I want to get 403 error code without parsing server response. My expectation is
that slave has it, but not forward to the job.

I've tried 
KIO::Scheduler::connect(SIGNAL(slaveError(KIO::Slave*,int,QString)), this,
SLOT(slotSlaveError(KIO::Slave*,int,QString)));

but slotSlaveError() is never called.

The example looks outdated bcs of this commented line:
https://github.com/KDE/kio/blob/master/tests/kioslavetest.cpp#L175. Is that all
stuff with getConnectedSlave deprecated?

Is anything broken in KIO? Are there a way to get HTTP error code from slave
via TransferJob and KIO::get()?

STEPS TO REPRODUCE
1. One may use https://httpstat.us/403 to test

ADDITIONAL INFORMATION
Operating System: Kubuntu 19.10
KDE Plasma Version: 5.17.2
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.4
Kernel Version: 5.3.0-19-generic
OS Type: 64-bit
Processors: 4 × Intel® Core™ i7-3520M CPU @ 2.90GHz
Memory: 7,6 GiB of RAM

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to