Changeset 16110
- Timestamp:
- 2008-06-23T17:13:17+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI4gs3.pm
r16100 r16110 17 17 my $self; 18 18 if ((defined $ENV{'REQUEST_METHOD'}) && ($ENV{'REQUEST_METHOD'} eq "POST")) { 19 my $line = <STDIN>; 20 # Multipart POST requests' boundaries created by Java's POST method on the client-GLI side 21 # start with --. If there are other kinds of languages and boundaries we will be dealing 22 # with, we can list those patterns alongside here in the (), separated by |: 23 my $multipartPostBoundary = q/^(--)/; 24 25 # cmd=upload-collection-file is not read into $line from STDIN, only the boundary (a 26 # sequence of chars preceeded by --) is encountered. Either we can match on POST requests 27 # whose cmds contain "download" OR we can look for $line NOT being boundary, to process $line. 28 # Multipart POST messages are processed by the zero-argument CGI constructor. 29 if ((defined $line) && ($line ne "") && ($line !~ /$multipartPostBoundary/)) { 30 $self = new CGI($line); 19 20 # 1st check if we're dealing with the upload-coll-file cmd. Because it will be a 21 # multipart POST message and must be dealt with by the default CGI() constructor 22 if((defined $ENV{'QUERY_STRING'}) && ($ENV{'QUERY_STRING'} =~ /upload-collection-file/)) { 23 $self = new CGI(); 31 24 } 32 else { 33 $self = new CGI(); 34 } 25 26 else { # all other POST commands processed using CGI($line) 27 my $line = <STDIN>; 28 if ((defined $line) && ($line ne "")) { 29 $self = new CGI($line); 30 } 31 } 35 32 } 36 else { 33 34 # If one of the conditions above did not hold, then self=new CGI() 35 if(!defined $self) { 37 36 $self = new CGI(); 38 37 }
Note:
See TracChangeset
for help on using the changeset viewer.