I'm using Mantis 1.1.8 to keep my software bugs and I'm working to automate a bug report from my C++ application when a problem happens to someone who is using it. So I've debugged the HTTP traffic during the normal work on Mantis and the following are the HTTP Header and Object:
HTTP Header
Code: Select all
POST /mantis/bug_report.php HTTP/1.1
POST
/mantis/bug_report.php
HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 showdtl=Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 showdtl=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3 showdtl=it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.example.com/mantis/bug_report_page.php
Cookie: MANTIS_BUG_LIST_COOKIE=4%2C2%2C1; PHPSESSID=d2218bf1c4171de429fe7932c8af7d45; MANTIS_STRING_COOKIE=2d895684f34453698ae611bbb0231b7888a62fe7831b0cfd8e9e06bde5616de4
Content-Type: multipart/form-data; boundary=---------------------------207982800927157
Content-Length: 1615
Code: Select all
-----------------------------207982800927157
Content-Disposition: form-data; name="bug_report_token"
20090831-c9fc2e04d74851c3b8b24d62b05a13e4ae349a70
-----------------------------207982800927157
Content-Disposition: form-data; name="m_id"
0
-----------------------------207982800927157
Content-Disposition: form-data; name="project_id"
1
-----------------------------207982800927157
Content-Disposition: form-data; name="handler_id"
0
-----------------------------207982800927157
Content-Disposition: form-data; name="category"
Database Query
-----------------------------207982800927157
Content-Disposition: form-data; name="reproducibility"
70
-----------------------------207982800927157
Content-Disposition: form-data; name="severity"
50
-----------------------------207982800927157
Content-Disposition: form-data; name="priority"
30
-----------------------------207982800927157
Content-Disposition: form-data; name="summary"
Riassunto
-----------------------------207982800927157
Content-Disposition: form-data; name="description"
Descrizione
-----------------------------207982800927157
Content-Disposition: form-data; name="additional_info"
-----------------------------207982800927157
Content-Disposition: form-data; name="max_file_size"
5000000
-----------------------------207982800927157
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
-----------------------------207982800927157
Content-Disposition: form-data; name="view_state"
10
-----------------------------207982800927157--
Ok, I,ve tried to read the bug_report.php code(I'm not so expert) to understand how to fix my application. I suspect, probably, that it depends on the first paramer "bug_report_token":APPLICATION ERROR #2800
Invalid form security token. Did you submit the form twice by accident?
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
Code: Select all
-----------------------------207982800927157
Content-Disposition: form-data; name="bug_report_token"
20090831-c9fc2e04d74851c3b8b24d62b05a13e4ae349a70
Code: Select all
# --------------------------------------------------------
# $Id: bug_report.php,v 1.49.2.1 2007-10-13 22:32:51 giallu Exp $
# --------------------------------------------------------
# This page stores the reported bug
require_once( 'core.php' );
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path.'string_api.php' );
require_once( $t_core_path.'file_api.php' );
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'custom_field_api.php' );
form_security_validate( 'bug_report' );
access_ensure_project_level( config_get('report_bug_threshold' ) );
$t_bug_data = new BugData;
$t_bug_data->build = gpc_get_string( 'build', '' );
$t_bug_data->platform = gpc_get_string( 'platform', '' );