You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Elodie Tasia <e....@ever-team.com> on 2002/03/13 09:12:31 UTC

problem with Host header

Hi !

I'm using a code example that was given on this list :

        HttpClient client=new HttpClient();
        client.startSession("localhost",80, new Credentials("root","root"));
        client.setDebug(10);
        MkcolMethod mc=new MkcolMethod();
        mc.setPath("/newpath");
        client.executeMethod(mc);
        client.endSession();

The method generated with it is :

MKCOL /newpath HTTP/1.1
Content-Length: 0
Host: http://localhost
User-Agent: Jakarta HTTP Client/1.0

But I receive the error message :

HTTP/1.1 400 Bad Request
Date: Wed, 13 Mar 2002 08:09:14 GMT
Server: Apache/1.3.20 (Win32) DAV/1.0.3-dev
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1

And I've just found why ! Because the host should be localhost, and not http://localhost.
But the way how the host header is generated depends not on me.. What can I do ?




Re: problem with Host header

Posted by Elodie Tasia <e....@ever-team.com>.
Because of that problem, I've just re-installed Slide server 1.0.16. I
didn't change anything (ok, maybe I added one user ot two...), and I
launched the startup.bat as it was. I can't imagine how and why the server
wouldn't be correctly configured by default... :o(
I tried with Apache + mod_dav too, and when you've got "Host:
http://localhost", the logs file says "client sent malformed Host header".
I'm sorry, but I believe it !!! And since it worked when I set the host
header as "Host: localhost", I didn't go farther...
I just say that *maybe* there is *somewhere* a * very little* problem with
the client librairy (for example : the "http://" should be deleted and it is
not) but I don't think that the problem comes from the server...
I'm not aggressive, but maybe other people did have that problem once time,
and I just want to understand... ;o)

Regards,
Elo

----- Original Message -----
From: "Sung-Gu" <je...@apache.org>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
Sent: Thursday, March 14, 2002 10:11 AM
Subject: Re: problem with Host header


>
> Sorry, I guessed you wrong.
> I thought that you might not be with the WebDAV server correctly.
> And host parameter is no problem with "http://" or not.  :(
>
> However, it shouldn't be there... :(
> Did you run with common http in Slide cvs repository?
>
> Sung-Gu
>
>
> ----- Original Message -----
> From: "Elodie Tasia" <e....@ever-team.com>
> To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
> Sent: Thursday, March 14, 2002 4:39 PM
> Subject: Re: problem with Host header
>
>
> > I don't understand what you mean...
> > The problem is that there is a "http://" before my "localhost" that
> > should'nt be here, no ?
> >
> >
> > ----- Original Message -----
> > From: "Sung-Gu" <je...@apache.org>
> > To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
> > Sent: Thursday, March 14, 2002 5:06 AM
> > Subject: Re: problem with Host header
> >
> >
> > >
> > > Did you set the web root as WebDAV support manually, didn't you?
> > > I think you'd better consider the security in the server side.
> > > You're making the collection on the web root.
> > >
> > > Sung-Gu
> > >
> > > ----- Original Message -----
> > > From: "Elodie Tasia" <e....@ever-team.com>
> > > To: "Slide Group" <sl...@jakarta.apache.org>
> > > Sent: Wednesday, March 13, 2002 5:12 PM
> > > Subject: problem with Host header
> > >
> > >
> > > Hi !
> > >
> > > I'm using a code example that was given on this list :
> > >
> > >         HttpClient client=new HttpClient();
> > >         client.startSession("localhost",80, new
> > Credentials("root","root"));
> > >         client.setDebug(10);
> > >         MkcolMethod mc=new MkcolMethod();
> > >         mc.setPath("/newpath");
> > >         client.executeMethod(mc);
> > >         client.endSession();
> > >
> > > The method generated with it is :
> > >
> > > MKCOL /newpath HTTP/1.1
> > > Content-Length: 0
> > > Host: http://localhost
> > > User-Agent: Jakarta HTTP Client/1.0
> > >
> > > But I receive the error message :
> > >
> > > HTTP/1.1 400 Bad Request
> > > Date: Wed, 13 Mar 2002 08:09:14 GMT
> > > Server: Apache/1.3.20 (Win32) DAV/1.0.3-dev
> > > Connection: close
> > > Transfer-Encoding: chunked
> > > Content-Type: text/html; charset=iso-8859-1
> > >
> > > And I've just found why ! Because the host should be localhost, and
not
> > http://localhost.
> > > But the way how the host header is generated depends not on me.. What
can
> > I do ?
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: problem with Host header

Posted by Sung-Gu <je...@apache.org>.
Sorry, I guessed you wrong.
I thought that you might not be with the WebDAV server correctly.
And host parameter is no problem with "http://" or not.  :(

However, it shouldn't be there... :(
Did you run with common http in Slide cvs repository?

Sung-Gu


----- Original Message ----- 
From: "Elodie Tasia" <e....@ever-team.com>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
Sent: Thursday, March 14, 2002 4:39 PM
Subject: Re: problem with Host header


> I don't understand what you mean...
> The problem is that there is a "http://" before my "localhost" that
> should'nt be here, no ?
> 
> 
> ----- Original Message -----
> From: "Sung-Gu" <je...@apache.org>
> To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
> Sent: Thursday, March 14, 2002 5:06 AM
> Subject: Re: problem with Host header
> 
> 
> >
> > Did you set the web root as WebDAV support manually, didn't you?
> > I think you'd better consider the security in the server side.
> > You're making the collection on the web root.
> >
> > Sung-Gu
> >
> > ----- Original Message -----
> > From: "Elodie Tasia" <e....@ever-team.com>
> > To: "Slide Group" <sl...@jakarta.apache.org>
> > Sent: Wednesday, March 13, 2002 5:12 PM
> > Subject: problem with Host header
> >
> >
> > Hi !
> >
> > I'm using a code example that was given on this list :
> >
> >         HttpClient client=new HttpClient();
> >         client.startSession("localhost",80, new
> Credentials("root","root"));
> >         client.setDebug(10);
> >         MkcolMethod mc=new MkcolMethod();
> >         mc.setPath("/newpath");
> >         client.executeMethod(mc);
> >         client.endSession();
> >
> > The method generated with it is :
> >
> > MKCOL /newpath HTTP/1.1
> > Content-Length: 0
> > Host: http://localhost
> > User-Agent: Jakarta HTTP Client/1.0
> >
> > But I receive the error message :
> >
> > HTTP/1.1 400 Bad Request
> > Date: Wed, 13 Mar 2002 08:09:14 GMT
> > Server: Apache/1.3.20 (Win32) DAV/1.0.3-dev
> > Connection: close
> > Transfer-Encoding: chunked
> > Content-Type: text/html; charset=iso-8859-1
> >
> > And I've just found why ! Because the host should be localhost, and not
> http://localhost.
> > But the way how the host header is generated depends not on me.. What can
> I do ?
> >
> >
> >
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 

Re: problem with Host header

Posted by Elodie Tasia <e....@ever-team.com>.
I don't understand what you mean...
The problem is that there is a "http://" before my "localhost" that
should'nt be here, no ?


----- Original Message -----
From: "Sung-Gu" <je...@apache.org>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
Sent: Thursday, March 14, 2002 5:06 AM
Subject: Re: problem with Host header


>
> Did you set the web root as WebDAV support manually, didn't you?
> I think you'd better consider the security in the server side.
> You're making the collection on the web root.
>
> Sung-Gu
>
> ----- Original Message -----
> From: "Elodie Tasia" <e....@ever-team.com>
> To: "Slide Group" <sl...@jakarta.apache.org>
> Sent: Wednesday, March 13, 2002 5:12 PM
> Subject: problem with Host header
>
>
> Hi !
>
> I'm using a code example that was given on this list :
>
>         HttpClient client=new HttpClient();
>         client.startSession("localhost",80, new
Credentials("root","root"));
>         client.setDebug(10);
>         MkcolMethod mc=new MkcolMethod();
>         mc.setPath("/newpath");
>         client.executeMethod(mc);
>         client.endSession();
>
> The method generated with it is :
>
> MKCOL /newpath HTTP/1.1
> Content-Length: 0
> Host: http://localhost
> User-Agent: Jakarta HTTP Client/1.0
>
> But I receive the error message :
>
> HTTP/1.1 400 Bad Request
> Date: Wed, 13 Mar 2002 08:09:14 GMT
> Server: Apache/1.3.20 (Win32) DAV/1.0.3-dev
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=iso-8859-1
>
> And I've just found why ! Because the host should be localhost, and not
http://localhost.
> But the way how the host header is generated depends not on me.. What can
I do ?
>
>
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: problem with Host header

Posted by Sung-Gu <je...@apache.org>.
Did you set the web root as WebDAV support manually, didn't you?
I think you'd better consider the security in the server side.
You're making the collection on the web root.

Sung-Gu

----- Original Message ----- 
From: "Elodie Tasia" <e....@ever-team.com>
To: "Slide Group" <sl...@jakarta.apache.org>
Sent: Wednesday, March 13, 2002 5:12 PM
Subject: problem with Host header


Hi !

I'm using a code example that was given on this list :

        HttpClient client=new HttpClient();
        client.startSession("localhost",80, new Credentials("root","root"));
        client.setDebug(10);
        MkcolMethod mc=new MkcolMethod();
        mc.setPath("/newpath");
        client.executeMethod(mc);
        client.endSession();

The method generated with it is :

MKCOL /newpath HTTP/1.1
Content-Length: 0
Host: http://localhost
User-Agent: Jakarta HTTP Client/1.0

But I receive the error message :

HTTP/1.1 400 Bad Request
Date: Wed, 13 Mar 2002 08:09:14 GMT
Server: Apache/1.3.20 (Win32) DAV/1.0.3-dev
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1

And I've just found why ! Because the host should be localhost, and not http://localhost.
But the way how the host header is generated depends not on me.. What can I do ?