Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-09

FPC bug tracker page is sniffing user agents?

7 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

Accessing http://bugs.freepascal.org/login_page.php

Using the following user agent (Opera in Mac OS X):

Opera/9.80 (Macintosh; Intel Mac OS X 10.6.1; U; en) Presto/2.9.168 Version/11.50

I get:

HTTP/1.1 400 Bad Request
Date: Sun, 25 Sep 2011 09:48:31 GMT
Server: Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.6.5 PHP/5.2.4-2ubuntu5.17 with Suhosin-Patch
Vary: Accept-Encoding
Content-Length: 514
Connection: close
Content-Type: text/html; charset=iso-8859-1

Size=514
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br /> Request header field is missing ':' separator.<br /> <pre>
Opera/9.80 (Macintosh; Intel Mac OS X 10.6.1; U; en) Presto/2.9.168 Version/11.50</pre>
</p>
<hr>
<address>Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.6.5 PHP/5.2.4-2ubuntu5.17 with Suhosin-Patch Port 80</address>
</body></html>

If I use the user agent from Firefox I get the propor page.

I tested with a program written in fpc which can be found here (and with the browsers too, of course):
http://p-tools.svn.sourceforge.net/viewvc/p-tools/httpclient/

Any ideas?

AFAIK we don't have a special version of our pages, so I suppose that we should not sniff user agents.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Jonas Maebe
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
AFAIK we don't have a special version of our pages, so I suppose that we should not sniff user agents.

The error message you show doesn't indicate that the server is sniffing user agents. It only indicates that that part of the request header was not understood (possibly the user-agent field, but that is irrelevant: the server always parses the entire request header to figure out what it should do, regardless of whether any particular actions are taken in response to them).

It's probably simply a bug in the apache version (which is quite outdated, the current version is 2.2.21; but maybe the server's distribution doesn't have any newer versions).

Jonas

Reply by email

Felipe Monteiro de Carvalho
to Jonas Maebe

Ok, testing again this error seams to have disappeared ... maybe my original post has nothing to do with what I really wanted to investigate.

The original issue that I wanted to investigate here is that accessing http://bugs.freepascal.org/login_page.php with Opera for Mac OS X I get only the top blue bar, with an empty contents area, while in other browsers it works fine. Acessing other pages works with Opera.

Opera reports that it gets this page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<head>
<link rel="stylesheet" type="text/css"
href="http://bugs.freepascal.org/css/default.css" /> <link rel="stylesheet" type="text/css" href="/css/fp.css" /> <script type="text/javascript" language="JavaScript"><!-- if(document.layers) {document.write("<style>td{padding:0px;}<\/style>")}

	// --></script>
	<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Pragma-directive" content="no-cache" />
	<meta http-equiv="Cache-Directive" content="no-cache" />
	<meta http-equiv="Expires" content="Sun, 25 Sep 2011 10:44:56 GMT" />

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <title>Free Pascal/Lazarus Bug Tracker</title>
<script type="text/javascript" language="JavaScript" src="javascript/common.js"></script>
<script type="text/JavaScript" src="javascript/ajax.js"></script> </head>
<body>
<link rel="stylesheet" type="text/css" href="css/fp.css" /> <div id="header">
<div id="menu">
<a href="http://www.freepascal.org/">Home</a>
<a href="http://www.freepascal.org/news.var">News</a> <a href="http://www.freepascal.org/download.var">Download</a> <a href="http://wiki.freepascal.org/">Wiki</a>
<a href="http://community.freepascal.org:10000">Community</a> <a href="http://www.freepascal.org/docs.var">Documentation</a> <a href="http://mantis.freepascal.org/set_project.php?project_id=6">Bug tracker</a>
</div>
<div class="spacer"></div>

Which seams cutted.

Any ideas? The error is 100% reproducible. I vaguely remember having faced it in the past, but I don't remember if it ever got solved.

Felipe Monteiro de Carvalho

Reply by email

Michael Van Canneyt
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 9 lines
Ok, testing again this error seams to have disappeared ... maybe my original post has nothing to do with what I really wanted to investigate. Which seams cutted. Any ideas? The error is 100% reproducible. I vaguely remember having faced it in the past, but I don't remember if it ever got solved.

To my knowledge, we don't do anything browser specific at the server level. That suggests either a bug in Opera or a faulty internet connection.

Michael.

Reply by email

ABorka
to Felipe Monteiro de Carvalho: Accessing http://bugs.freepascal.org/login_page.php Using the following user agent (Opera…
Felipe Monteiro de Carvalho wrote 49 lines
Hello, Accessing http://bugs.freepascal.org/login_page.php Using the following user agent (Opera in Mac OS X): Opera/9.80 (Macintosh; Intel Mac OS X 10.6.1; U; en) Presto/2.9.168 Version/11.50 I get: HTTP/1.1 400 Bad Request Date: Sun, 25 Sep 2011 09:48:31 GMT Server: Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.6.5 PHP/5.2.4-2ubuntu5.17 with Suhosin-Patch Vary: Accept-Encoding Content-Length: 514 Connection: close Content-Type: text/html; charset=iso-8859-1 Size=514 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> Request header field is missing ':' separator.<br /> <pre> Opera/9.80 (Macintosh; Intel Mac OS X 10.6.1; U; en) Presto/2.9.168 Version/11.50</pre> </p> <hr> <address>Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.6.5 PHP/5.2.4-2ubuntu5.17 with Suhosin-Patch Port 80</address> </body></html> If I use the user agent from Firefox I get the propor page. I tested with a program written in fpc which can be found here (and with the browsers too, of course): http://p-tools.svn.sourceforge.net/viewvc/p-tools/httpclient/ Any ideas? AFAIK we don't have a special version of our pages, so I suppose that we should not sniff user agents. thanks,

It might be totally unrelated (not sure if the bugs site uses fpweb) but we had a bug with content length being incorrect when an error message was generated in fpweb (was fixed in revision 17597). Different browsers handle the content-length header value differently, even the same browser handles it differently on different OS-es (sometimes ignores it and uses the full response page, sometimes it cuts the response page to the content-length header value which can be a problem if the value is incorrect).

AB

Reply by email

Felipe Monteiro de Carvalho
to ABorka
ABorka wrote
It might be totally unrelated (not sure if the bugs site uses fpweb)

Unlikely to be related since the page being accessed is php

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Felipe Monteiro de Carvalho

2011/9/25 Flávio Etrusco :

Se você entrar por outro endereço (bugs.freepascal.org) funciona?

This address redirects me to the problematic tapge

Eu lembro vagamente de algo parecido quando o browser tinha cookies desatualizados (ex. mandar o mantis guardar suas credencais, trocar a senha usando outro browser ou perfil). Aí tinha que entrar "explicitamente" na página de logout.

Indeed, I cleared all cookies from bugs.freepascal.org and the page now works =) An interresting clue.

Felipe Monteiro de Carvalho

Reply by email