httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16593] New: - PUT/If-match (etag) handling seems to be broken
Date Thu, 30 Jan 2003 13:04:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16593>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16593

PUT/If-match (etag) handling seems to be broken

           Summary: PUT/If-match (etag) handling seems to be broken
           Product: Apache httpd-2.0
           Version: HEAD
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_dav
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: julian.reschke@gmx.de


The following scenario seems to consistently fail with a 412:

1) GET existing resource, obtain etag
2) (modify content)
3) PUT with If-match: etag header

-- windows scripting host example script -- 
var req = new ActiveXObject ("MSXML2.ServerXMLHTTP");

var uri = WScript.Arguments(0);
var user = null;
var pwd = null;

if (WScript.Arguments.length > 1) {
  user = WScript.Arguments(1);
}

if (WScript.Arguments.length > 2) {
  pwd = WScript.Arguments(2);
}


req.open("GET", uri, false, user, pwd);
req.send();

if (req.status < 200 || req.status >= 300) {
  WScript.Echo("unexpected status upon GET: " + req.status);
  WScript.Quit(2);
}

var etag = req.getResponseHeader("etag");
WScript.Echo("etag: " + etag);

var txt = req.responseText + "\nappended line";
WScript.Echo("new content: " + txt);


req.open("PUT", uri, false, user, pwd);
req.setRequestHeader("if-match", etag);
req.send(txt);

if (req.status < 200 || req.status >= 300) {
  WScript.Echo("unexpected status upon PUT: " + req.status + " " + 
req.responseText);
  WScript.Quit(2);
}

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message