Can http/1.1 client use POST and chunked encoding to provide information to Apache1.2.1?

Can http/1.1 client use POST and chunked encoding to provide information to Apache1.2.1?

Post by Yi MIA » Fri, 14 Nov 1997 04:00:00



Hi,

I am design a http client to provide information to Apach server
(1.2.1), which is under my control, with POST method and chunked
encoding. But I got the error_log of forbidden.  The related information
is attached below. Why it is forbidden ( from http client to http server
with post and transfer-encoding, security?)? Why I need content-length
when transfer-encoding is applied? There is not restriction in terms of
HTTP spec., isnt'it?

I check the file access.conf (and other confs as well ) and there is no
any limit for get or post or I do not fully understand the setting. I am
really stunck there.
I will appreciate if somebody can help.

******information from error_log of apache server*******
[Thu Nov 13 15:13:50 1997] access to /cgi-bin/record failed for
myhost.mydomain, reason: chunked Transfer-Encoding forbidden
[Thu Nov 13 15:17:29 1997] access to /cgi-bin/record failed for
myhost.mydomain, reason: chunked Transfer-Encoding forbidden

******information from access_log of apache server*******
mramber.cls.passport.ca - - [13/Nov/1997:15:13:50 -0500]
"post/cgi-bin/record HTTP/1.1" 411 189
mramber.cls.passport.ca - - [13/Nov/1997:15:17:29 -0500] "post
/cgi-bin/record http/1.1" 411 177

******the information from unix consol********
$ telnet myhost 80
Trying 199.246.39.160...
Connected to myhost.mydomain.
Escape character is '^]'.
post /cgi-bin/record http/1.1
host:myhost.mydomain
content-type:text/plain
transfer-encoding:chunked

HTTP/1.1 411 Length Required
Date: Thu, 13 Nov 1997 20:16:33 GMT
Server: Apache/1.2.1
Connection: close
Content-Type: text/html

<HTML><HEAD>
<TITLE>411 Length Required</TITLE>
</HEAD><BODY>
<H1>Length Required</H1>
A request of the requested method post requires a valid
Content-length.<P>
</BODY></HTML>
Connection closed by foreign host.
$

Yi MIAO

 
 
 

Can http/1.1 client use POST and chunked encoding to provide information to Apache1.2.1?

Post by Marc Slemk » Sat, 15 Nov 1997 04:00:00



Quote:>Hi,
>I am design a http client to provide information to Apach server
>(1.2.1), which is under my control, with POST method and chunked
>encoding. But I got the error_log of forbidden.  The related information
>is attached below. Why it is forbidden ( from http client to http server
>with post and transfer-encoding, security?)? Why I need content-length
>when transfer-encoding is applied? There is not restriction in terms of
>HTTP spec., isnt'it?

It is unfortunately a limitation of Apache combined with CGI.

Should Apache dechunk the request?  If so, it needs to buffer the
entire request before sending it to the CGI because it needs to
set certain CGI environment variables dealing with the length.
Buffering the entire request often doesn't work well.

Should it pass it to the CGI chunked?  If it does, nearly all CGIs
will fall over and choke; in any case, it is silly for scripts to
need to know about chunking.

If this was easy to fix it would be fixed.  However, there is no
obvious fix while stuck with the limitations of CGI.

 
 
 

1. How to control HTTP/1.1 chunking?

Dear HTTP gurus,

We use, for some internal data distribution within our institute,
a few web-servers.  One of the datasets distributed in this way
is hit hard by the HTTP/1.1 chunking feature.

The "web-page" in question (actually simple output of a database
table) consists of a large number of short lines (in text/plain).
These lines are on average about 7 characters long.

Up to now this "web-page" was read by a specifically written bit
of C code emulating a HTTP/1.0 client.  I'm trying to convert
this client code to Java using the standard Java URL and HTTP
support classes.   These classes implement an HTTP/1.1 client.

The servers believe therefore (rightly) that they can use all
HTTP/1.1 features for these connections; amongst others this
means these servers will send that data in "chunks".

But a chunk is in practice only one line and around every chunk
it adds about 8 extra characters ("chunk management information"
or whatever the proper name is). This more than doubles the amount
of data transferred!

So, I would like to switch off, or otherwise control, this chunking.

There would seem to be two approaches, but for both I cannot find
the required information.

- Perhaps I could convince the standard Java HTTP connection
  classes to use the HTTP/1.0 protocol, the servers would then
  not use chunking.  But I cannot find a way to do this.

- Perhaps I could configure the servers not to use chunking,
  even on a HTTP/1.1 connection.   But again, I cannot find any
  documentation about how to do that.  The relevant servers use
  fairly recent versions of apache (1.3.19/1.3.22) or of tomcat
  (4.0.3)

So, does anyone have any suggestions?
Am I overlooking something?
Is chunking easily switched off, if I only looked at the right place?

Thanks in advance,
Met Vriendelijke Groeten,
Jon Krom

--

....................................................................
.  Address: J.G. Krom             phone:   +49 2461 61 5451        .
.           IPP FZ-Juelich        fax:     +49 2461 61 5452        .


.           Germany               WWW:     www.fz-juelich.de/ipp/  .
.                                 PGP:     DH/DSS 0xA9A357C4       .
....................................................................

           "Boundaries? I've never seen one, but I've been told
            they exist in some people's minds."  Thor Heyerdahl

2. Bridge question

3. Data chunking in HTTP/1.1

4. PTR_ERR

5. AIX, ICS v4.1.1 Can't POST when using SSL (https)

6. Newbie Desktop question...

7. Help with HTTP 1.1 encodings

8. October 16, 2002

9. Unixware 2.1 server for Unixware 1.1 client probs

10. apache http proxy - http/1.0 vs http/1.1

11. request: any HTTP/1.1 client?

12. HTTP 1.0 or HTTP 1.1