| 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(); |
|---|