| 32 | | my $line = <STDIN>; |
|---|
| 33 | | # Multipart POST requests' boundaries created by Java's POST method on the client-GLI side |
|---|
| 34 | | # start with --. If there are other kinds of languages and boundaries we will be dealing |
|---|
| 35 | | # with, we can list those patterns alongside here in the (), separated by |: |
|---|
| 36 | | my $multipartPostBoundary = q/^(--)/; |
|---|
| 37 | | |
|---|
| 38 | | # cmd=upload-collection-file is not read into $line from STDIN, only the boundary (a |
|---|
| 39 | | # sequence of chars preceeded by --) is encountered. Either we can match on POST requests |
|---|
| 40 | | # whose cmds contain "download" OR we can look for $line NOT being boundary, to process $line. |
|---|
| 41 | | # Multipart POST messages are processed by the zero-argument CGI constructor. |
|---|
| 42 | | if ((defined $line) && ($line ne "") && ($line !~ /$multipartPostBoundary/)) { #&& ($line =~ /download/)) { |
|---|
| 43 | | $self = new CGI($line); |
|---|
| 44 | | } |
|---|
| | 31 | |
|---|
| | 32 | # Check if we're dealing with the upload-coll-file cmd. Because it will be a |
|---|
| | 33 | # multipart POST message and must be dealt with by the default CGI() constructor |
|---|
| | 34 | if((defined $ENV{'QUERY_STRING'}) && ($ENV{'QUERY_STRING'} =~ /upload-collection-file/)) { |
|---|
| | 35 | $self = new CGI(); |
|---|
| | 36 | } |
|---|
| | 37 | |
|---|
| | 38 | else { # all other POST commands processed using CGI($line) |
|---|
| | 39 | my $line = <STDIN>; |
|---|
| | 40 | if ((defined $line) && ($line ne "")) { |
|---|
| | 41 | $self = new CGI($line); |
|---|
| | 42 | } |
|---|
| | 43 | } |
|---|
| | 44 | |
|---|