Board index » delphi » idHTTP causing 500 Internal Server error

idHTTP causing 500 Internal Server error

Hi all,

I'm writing a small HTTP proxy server and have a encounter a problem.  Here
are the way things are currently setup.

I have a idHTTP client and idHTTPServer. When the server receives a GET
command,  I catch it in the OnGetCommand event and assign the headers from
the RequestInfo over to my Client.Request.<header_name>.  The GET command is
then formatted like so;

myclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

Everything works fantastic EXCEPT when I click on anything CGI related.  I
always get an HTTP 500 error (Internal server error)

Does anybody have any idea why this is happening?  I've tried several
formatting variations on the get request but all produce the same results.

Thanks in advance.

Cheers!
Ken

 

Re:idHTTP causing 500 Internal Server error


Something funky is definitely going on here.   When you look at
http://www.e{*word*277}.com you see that most of their links look something like
http://www.e{*word*277}.com/_?cj .   Note the underscore and THEN the question
mark.  idHTTP is parsing out the underscore and the question mark.  Anybody
got any idea on how to correct this???

TIA
Ken

Quote
"Ken" <techs...@helpconsulting.net> wrote in message

news:3b1db4ee_2@dnews...
Quote
> Hi all,

> I'm writing a small HTTP proxy server and have a encounter a problem.
Here
> are the way things are currently setup.

> I have a idHTTP client and idHTTPServer. When the server receives a GET
> command,  I catch it in the OnGetCommand event and assign the headers from
> the RequestInfo over to my Client.Request.<header_name>.  The GET command
is
> then formatted like so;

> myclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

> Everything works fantastic EXCEPT when I click on anything CGI related.  I
> always get an HTTP 500 error (Internal server error)

> Does anybody have any idea why this is happening?  I've tried several
> formatting variations on the get request but all produce the same results.

> Thanks in advance.

> Cheers!
> Ken

Re:idHTTP causing 500 Internal Server error


don't use the OnGetCommand event.

HTH

Quote
"Ken" <techs...@helpconsulting.net> wrote in message

news:3b1dbe67_1@dnews...
Quote
> Something funky is definitely going on here.   When you look at
> http://www.e{*word*277}.com you see that most of their links look something like
> http://www.e{*word*277}.com/_?cj .   Note the underscore and THEN the question
> mark.  idHTTP is parsing out the underscore and the question mark.
Anybody
> got any idea on how to correct this???

> TIA
> Ken

> "Ken" <techs...@helpconsulting.net> wrote in message
> news:3b1db4ee_2@dnews...
> > Hi all,

> > I'm writing a small HTTP proxy server and have a encounter a problem.
> Here
> > are the way things are currently setup.

> > I have a idHTTP client and idHTTPServer. When the server receives a GET
> > command,  I catch it in the OnGetCommand event and assign the headers
from
> > the RequestInfo over to my Client.Request.<header_name>.  The GET
command
> is
> > then formatted like so;

> > myclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

> > Everything works fantastic EXCEPT when I click on anything CGI related.
I
> > always get an HTTP 500 error (Internal server error)

> > Does anybody have any idea why this is happening?  I've tried several
> > formatting variations on the get request but all produce the same
results.

> > Thanks in advance.

> > Cheers!
> > Ken

Re:idHTTP causing 500 Internal Server error


i see you based it on idhttp**** , why not base it on idtcp*****

HTH

Quote
"Ken" <techs...@helpconsulting.net> wrote in message

news:3b1dbe67_1@dnews...
Quote
> Something funky is definitely going on here.   When you look at
> http://www.e{*word*277}.com you see that most of their links look something like
> http://www.e{*word*277}.com/_?cj .   Note the underscore and THEN the question
> mark.  idHTTP is parsing out the underscore and the question mark.
Anybody
> got any idea on how to correct this???

> TIA
> Ken

> "Ken" <techs...@helpconsulting.net> wrote in message
> news:3b1db4ee_2@dnews...
> > Hi all,

> > I'm writing a small HTTP proxy server and have a encounter a problem.
> Here
> > are the way things are currently setup.

> > I have a idHTTP client and idHTTPServer. When the server receives a GET
> > command,  I catch it in the OnGetCommand event and assign the headers
from
> > the RequestInfo over to my Client.Request.<header_name>.  The GET
command
> is
> > then formatted like so;

> > myclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

> > Everything works fantastic EXCEPT when I click on anything CGI related.
I
> > always get an HTTP 500 error (Internal server error)

> > Does anybody have any idea why this is happening?  I've tried several
> > formatting variations on the get request but all produce the same
results.

> > Thanks in advance.

> > Cheers!
> > Ken

Re:idHTTP causing 500 Internal Server error


Thank you for your response, however, what else am I supposed to use???

Regards,
Ken

Quote
"Gooijen" <bas_gooi...@yahoo.com> wrote in message news:3b1e654a_1@dnews...
> don't use the OnGetCommand event.

> HTH

> "Ken" <techs...@helpconsulting.net> wrote in message
> news:3b1dbe67_1@dnews...
> > Something funky is definitely going on here.   When you look at
> > http://www.e{*word*277}.com you see that most of their links look something
like
> > http://www.e{*word*277}.com/_?cj .   Note the underscore and THEN the question
> > mark.  idHTTP is parsing out the underscore and the question mark.
> Anybody
> > got any idea on how to correct this???

> > TIA
> > Ken

> > "Ken" <techs...@helpconsulting.net> wrote in message
> > news:3b1db4ee_2@dnews...
> > > Hi all,

> > > I'm writing a small HTTP proxy server and have a encounter a problem.
> > Here
> > > are the way things are currently setup.

> > > I have a idHTTP client and idHTTPServer. When the server receives a
GET
> > > command,  I catch it in the OnGetCommand event and assign the headers
> from
> > > the RequestInfo over to my Client.Request.<header_name>.  The GET
> command
> > is
> > > then formatted like so;

> > > myclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

> > > Everything works fantastic EXCEPT when I click on anything CGI
related.
> I
> > > always get an HTTP 500 error (Internal server error)

> > > Does anybody have any idea why this is happening?  I've tried several
> > > formatting variations on the get request but all produce the same
> results.

> > > Thanks in advance.

> > > Cheers!
> > > Ken

Re:idHTTP causing 500 Internal Server error


Do you have any samples are suggestions on how I could get more information
on doing this?

Regards
Ken

Quote
"Gooijen" <bas_gooi...@yahoo.com> wrote in message news:3b1e65bc_1@dnews...
> i see you based it on idhttp**** , why not base it on idtcp*****

> HTH

> "Ken" <techs...@helpconsulting.net> wrote in message
> news:3b1dbe67_1@dnews...
> > Something funky is definitely going on here.   When you look at
> > http://www.e{*word*277}.com you see that most of their links look something
like
> > http://www.e{*word*277}.com/_?cj .   Note the underscore and THEN the question
> > mark.  idHTTP is parsing out the underscore and the question mark.
> Anybody
> > got any idea on how to correct this???

> > TIA
> > Ken

> > "Ken" <techs...@helpconsulting.net> wrote in message
> > news:3b1db4ee_2@dnews...
> > > Hi all,

> > > I'm writing a small HTTP proxy server and have a encounter a problem.
> > Here
> > > are the way things are currently setup.

> > > I have a idHTTP client and idHTTPServer. When the server receives a
GET
> > > command,  I catch it in the OnGetCommand event and assign the headers
> from
> > > the RequestInfo over to my Client.Request.<header_name>.  The GET
> command
> > is
> > > then formatted like so;

> > > myclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

> > > Everything works fantastic EXCEPT when I click on anything CGI
related.
> I
> > > always get an HTTP 500 error (Internal server error)

> > > Does anybody have any idea why this is happening?  I've tried several
> > > formatting variations on the get request but all produce the same
> results.

> > > Thanks in advance.

> > > Cheers!
> > > Ken

Re:idHTTP causing 500 Internal Server error


eg. you could create a new component based on the tidtcpserver,
override the execute function.

you could read the header with something like this:
athread.connection.readln in a while-loop.
parse the header for the host, create a tidtcpclient, connect to the host,
send a slightly modified header to the host, and send the replies from the
host to your local client ( athread.connection.write.... ).

in short, that is how it works.

HTH

Quote
"Ken" <techs...@helpconsulting.net> wrote in message

news:3b1ea71d_1@dnews...
Quote
> Do you have any samples are suggestions on how I could get more
information
> on doing this?

> Regards
> Ken

> "Gooijen" <bas_gooi...@yahoo.com> wrote in message

news:3b1e65bc_1@dnews...
Quote
> > i see you based it on idhttp**** , why not base it on idtcp*****

> > HTH

> > "Ken" <techs...@helpconsulting.net> wrote in message
> > news:3b1dbe67_1@dnews...
> > > Something funky is definitely going on here.   When you look at
> > > http://www.e{*word*277}.com you see that most of their links look something
> like
> > > http://www.e{*word*277}.com/_?cj .   Note the underscore and THEN the
question
> > > mark.  idHTTP is parsing out the underscore and the question mark.
> > Anybody
> > > got any idea on how to correct this???

> > > TIA
> > > Ken

> > > "Ken" <techs...@helpconsulting.net> wrote in message
> > > news:3b1db4ee_2@dnews...
> > > > Hi all,

> > > > I'm writing a small HTTP proxy server and have a encounter a
problem.
> > > Here
> > > > are the way things are currently setup.

> > > > I have a idHTTP client and idHTTPServer. When the server receives a
> GET
> > > > command,  I catch it in the OnGetCommand event and assign the
headers
> > from
> > > > the RequestInfo over to my Client.Request.<header_name>.  The GET
> > command
> > > is
> > > > then formatted like so;

> > > > myclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

> > > > Everything works fantastic EXCEPT when I click on anything CGI
> related.
> > I
> > > > always get an HTTP 500 error (Internal server error)

> > > > Does anybody have any idea why this is happening?  I've tried
several
> > > > formatting variations on the get request but all produce the same
> > results.

> > > > Thanks in advance.

> > > > Cheers!
> > > > Ken

Re:idHTTP causing 500 Internal Server error


if you need help with that, please let me know.

Quote
"Gooijen" <bas_gooi...@yahoo.com> wrote in message

news:3b1fdcd5$1_1@dnews...
Quote
> eg. you could create a new component based on the tidtcpserver,
> override the execute function.

> you could read the header with something like this:
> athread.connection.readln in a while-loop.
> parse the header for the host, create a tidtcpclient, connect to the host,
> send a slightly modified header to the host, and send the replies from the
> host to your local client ( athread.connection.write.... ).

> in short, that is how it works.

> HTH

> "Ken" <techs...@helpconsulting.net> wrote in message
> news:3b1ea71d_1@dnews...
> > Do you have any samples are suggestions on how I could get more
> information
> > on doing this?

> > Regards
> > Ken

> > "Gooijen" <bas_gooi...@yahoo.com> wrote in message
> news:3b1e65bc_1@dnews...
> > > i see you based it on idhttp**** , why not base it on idtcp*****

> > > HTH

> > > "Ken" <techs...@helpconsulting.net> wrote in message
> > > news:3b1dbe67_1@dnews...
> > > > Something funky is definitely going on here.   When you look at
> > > > http://www.e{*word*277}.com you see that most of their links look
something
> > like
> > > > http://www.e{*word*277}.com/_?cj .   Note the underscore and THEN the
> question
> > > > mark.  idHTTP is parsing out the underscore and the question mark.
> > > Anybody
> > > > got any idea on how to correct this???

> > > > TIA
> > > > Ken

> > > > "Ken" <techs...@helpconsulting.net> wrote in message
> > > > news:3b1db4ee_2@dnews...
> > > > > Hi all,

> > > > > I'm writing a small HTTP proxy server and have a encounter a
> problem.
> > > > Here
> > > > > are the way things are currently setup.

> > > > > I have a idHTTP client and idHTTPServer. When the server receives
a
> > GET
> > > > > command,  I catch it in the OnGetCommand event and assign the
> headers
> > > from
> > > > > the RequestInfo over to my Client.Request.<header_name>.  The GET
> > > command
> > > > is
> > > > > then formatted like so;

yclient.get( RequestInfo.document+'?'+RequestInfo.unparsedparams);

- Show quoted text -

Quote

> > > > > Everything works fantastic EXCEPT when I click on anything CGI
> > related.
> > > I
> > > > > always get an HTTP 500 error (Internal server error)

> > > > > Does anybody have any idea why this is happening?  I've tried
> several
> > > > > formatting variations on the get request but all produce the same
> > > results.

> > > > > Thanks in advance.

> > > > > Cheers!
> > > > > Ken

Other Threads