Subject: MOVE fails on collection when IP address is used in the Destination header.

From: "Michael J. Ryan" <[email-masked]>
Date: Mon, 25 Jun 2001 11:29:44 -0400

Hi Folks,
 I'm running into something that I could use some help with. I'm
trying to rename a collection and am receiving a 502 Bad Gateway.
It appears that if I use the hostname in the Destination header, ie,
webfolders.mydocsonline.com:80, then all goes well. However, if I resolve
it to its IP address and use that instead, 38.144.45.187:80,
then the command fails. Oh, the collection is empty in case that matters.

 Should the hostname and IP address be interchangable, or am I
required to always use the hostname as part of the Destination
header.  Below are copies of the working and non-working MOVE request.

Thanks in advance!

Michael

This fails: Using an IP address as the 'Destination:'

Renaming "/New Folder" to "/asdf"
Connecting to Host: 38.144.45.187 on Port 80
==================== HTTP 'MOVE' REQUEST ===============
MOVE /New%20Folder HTTP/1.1
Host: 38.144.45.187
User-Agent: SRT.WebIFS.Engine/1.0
Authorization: Basic abcdefghijklmnop=
Accept-Language: en-us
Overwrite: F
Destination: http://38.144.45.187:80/asdf
Content-Length: 0
=============== HTTP 'MOVE' REQUEST ===============

=============== HTTP Response Header ===============
HTTP/1.1 502 Bad Gateway
Date: Mon, 25 Jun 2001 15:09:11 GMT
Server: Apache/1.3.12 (Win32) DAV/0.9-MyDocs
Set-Cookie: MyDocC=3B3744a95417-551; path=/; EXPIRES=Sun, 06-Jan-02 12:00:00
GMT
Transfer-Encoding: chunked
Content-Type: text/html
=============== HTTP Response Header ===============

This works: using the URL as the 'Destionation:'
Renaming "/New Folder" to "/asdf"
Connecting to Host: 38.144.45.187 on Port 80
==================== HTTP 'MOVE' REQUEST ===============
MOVE /New%20Folder HTTP/1.1
Host: webfolders.mydocsonline.com
User-Agent: SRT.WebIFS.Engine/1.0
Authorization: Basic abcdefghijklmnop=
Accept-Language: en-us
Overwrite: F
Destination: http://webfolders.mydocsonline.com:80/asdf
Content-Length: 0
=============== HTTP 'MOVE' REQUEST ===============

=============== HTTP Response Header ===============
HTTP/1.1 201 Created
Date: Mon, 25 Jun 2001 15:17:41 GMT
Server: Apache/1.3.12 (Win32) DAV/0.9-MyDocs
Set-Cookie: MyDocC=3B3744b85615-461; path=/; EXPIRES=Sun, 06-Jan-02 12:00:00
GMT
Transfer-Encoding: chunked
Content-Type: text/html
=============== HTTP Response Header ===============

---

From: "Lisa Dusseault" <[email-masked]>
Date: Mon, 25 Jun 2001 15:47:05 -0700

> header.  Below are copies of the working and non-working MOVE request.

The host name and the IP address are not guaranteed to be interchangeable.
As Keith implied, in the Xythos implementation we only treat the host name
and IP address as identical if the administrator sets them up this way.

lisa

---

From: Joe Orton <[email-masked]>
Date: Mon, 25 Jun 2001 23:47:09 +0100

Hi,

> header.  Below are copies of the working and non-working MOVE request.

You should be using the hostname if you know it. If your client is given
a hostname, then resolves it to the IP address, and uses that IP address
the Host header, that defeats the whole point of having the Host header
in the first place: name-based virtual hosting. Consider that a serious
client bug. :)

If your client is only told the IP address by the user, then I think
you're stuck, unless you do a reverse DNS lookup, which might not be a
good idea anyway. Apache/mod_dav won't like an IP address in the
Destination header in the default configuration[*], and MOVE/COPY will
return 502.

Regards,

joe

[*] though it can be configured to know the IP address with the
ServerAlias directive