HTTP PUT on launchpadlibrarian.net for existing URL is broken

Bug #128982 reported by Daniel Hahler
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Unassigned

Bug Description

Using HTTP PUT for an existing URL on launchpadlibrarian acts like GET!

This causes e.g. kwrite to think the file had been saved successfully, when using the KDE IO-HTTP-Slave.

Instead, an error should get returned, if PUT is not implement or denied.

See:
---------------
$ telnet launchpadlibrarian.net 80
Trying 82.211.81.235...
Connected to launchpadlibrarian.net.
Escape character is '^]'.
PUT / HTTP/1.0

HTTP/1.1 200 OK
Date: Sat, 28 Jul 2007 23:31:22 GMT
Server: TwistedWeb/2.4.0
Content-length: 340
Content-type: text/html
Via: 1.0 launchpadlibrarian.net
Connection: close

        <html>
        <body>
        <h1>Launchpad Librarian</h1>
        <p>
        http://librarian.launchpad.net/ is a
        file repository used by <a href="https://launchpad.net/">Launchpad</a>.
        </p>
        <p><small>Copyright 2004-2007 Canonical Ltd.</small></p>
        <!-- kthxbye. -->
        </body></html>
        Connection closed by foreign host.
---------------

Revision history for this message
Diogo Matsubara (matsubara) wrote :

Couldn't reproduce:
$ telnet launchpadlibrarian.net 80
Trying 82.211.81.235...
Connected to launchpadlibrarian.net.
Escape character is '^]'.
PUT / HTTP/1.0

HTTP/1.1 400 Bad Request
Date: Tue, 31 Jul 2007 18:03:24 GMT
Server: Apache/2.0.55 (Ubuntu) mod_ssl/2.0.55 OpenSSL/0.9.8a
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
Connection closed by foreign host.

Changed in launchpad:
status: New → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

That's odd.
I've just tried it again, with the same result: 200.
Are you sure you've used HTTP/1.0? I'm getting a 400 for HTTP/1.1 - when the Host line is missing.

But you've probably copy'n'pasted your output, so.. strange.

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

I can reproduce this.

Changed in launchpad:
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Robert Collins (lifeless) wrote :

s$ telnet launchpadlibrarian.net 80
Trying 91.189.89.229...
Connected to launchpadlibrarian.net.
Escape character is '^]'.
PUT / HTTP/1.0

HTTP/1.1 411 Length Required

mpt / daniel - can you please supply more details about how you are triggering this?

Changed in launchpad-foundations:
status: Triaged → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

This looks like is has been fixed:
1. Robert, you're missing Content-Length (which was not required before)
2. Using Content-Length and content, the answer is "501 Not Implemented", which is correct

% telnet launchpadlibrarian.net 80
Trying 91.189.89.228...
Connected to launchpadlibrarian.net.
Escape character is '^]'.
PUT / HTTP/1.0
Content-Length: 5

12345
HTTP/1.1 501 Not Implemented
Date: Tue, 27 Jul 2010 14:39:14 GMT
Server: TwistedWeb/10.0.0
Content-Length: 146
Content-Type: text/html
X-Cache: MISS from nutmeg.canonical.com
X-Cache-Lookup: MISS from nutmeg.canonical.com:3128
Via: 1.0 nutmeg.canonical.com:3128 (squid/2.6.STABLE18)
Via: 1.0 launchpadlibrarian.net
Vary: Accept-Encoding
Connection: close

<html>
  <head><title>501 - Huh?</title></head>
  <body>
    <h1>Huh?</h1>
    <p>I don't know how to treat a PUT request.</p>
  </body>
</html>
Connection closed by foreign host.

Changed in launchpad-foundations:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.