Public bug reported:

Apt-cacher-ng makes Http status line phrase mandatory but as per RFC it
is optional..

Status Line should be as below but <reason-phrase> os optional
HTTP/<version> <status-code> <reason-phrase>

HTTP/1.0 & HTTP/1.1 → Required (e.g., "200 OK", "404 Not Found").
HTTP/2 → Optional (Clients typically ignore it).
HTTP/3 → Removed (Not included at all).

We have jfrog repository where we are not getting OK as it is optional

curl -I https://abcd.test.com/ubuntu/dists/jammy-updates/InRelease
HTTP/1.1 200
Date: Mon, 24 Mar 2025 08:58:07 GMT
Content-Type: application/octet-stream
Content-Length: 8103

Jfrog repository returning above status and apt-cacher-ng fails

We are getting below error when status line is not having OK.
Err:1 http://abcd.test.com/ubuntu jammy InRelease
  500  Remote or cache error [IP: 127.0.0.1 3142]

As a fix, we can remove the condition as status code servers the
purpose..

git diff src/httpdate.cc
diff --git a/src/httpdate.cc b/src/httpdate.cc
index ab83c7c..cf9b3bf 100644
--- a/src/httpdate.cc
+++ b/src/httpdate.cc
@@ -238,11 +239,6 @@ tRemoteStatus::tRemoteStatus(string_view s, int errorCode, 
bool stripHttpPrefix)
                auto tok = split.view();
                ok = !tok.empty() && 0 != (code = svtol(tok, 0));
        }
-       if (ok)
-       {
-               msg = split.right();
-               ok = !msg.empty();
-       }
        if (!ok)
        {
                code = errorCode;

** Affects: apt-cacher-ng (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2104110

Title:
  Apt-cacher-ng breaks with [500 Remote or cache error] when HTTP status
  line does not contain reason phrase

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt-cacher-ng/+bug/2104110/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to