[w3m-dev 02927] mailto: POST method with w3mmail.cgi
* file.c (loadGeneralFile): pass request even if SCM_UNKNOWN (for external URI loader) * scripts/w3mmail.cgi.in: support POST method From: SASAKI Takeshi <sasaki@ct.sakura.ne.jp>
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2002-01-30 SASAKI Takeshi <sasaki@ct.sakura.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 02927] mailto: POST method with w3mmail.cgi
|
||||||
|
* file.c (loadGeneralFile): pass request even if SCM_UNKNOWN
|
||||||
|
(for external URI loader)
|
||||||
|
* scripts/w3mmail.cgi.in: support POST method
|
||||||
|
|
||||||
2002-01-30 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
2002-01-30 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 02926] fixed w3mmail.cgi
|
* [w3m-dev 02926] fixed w3mmail.cgi
|
||||||
@@ -2355,4 +2362,4 @@
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.271 2002/01/29 16:31:09 ukai Exp $
|
$Id: ChangeLog,v 1.272 2002/01/29 17:16:35 ukai Exp $
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: file.c,v 1.47 2002/01/24 16:59:16 ukai Exp $ */
|
/* $Id: file.c,v 1.48 2002/01/29 17:16:35 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "myctype.h"
|
#include "myctype.h"
|
||||||
@@ -1082,7 +1082,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
|
|||||||
case SCM_UNKNOWN:
|
case SCM_UNKNOWN:
|
||||||
tmp = searchURIMethods(&pu);
|
tmp = searchURIMethods(&pu);
|
||||||
if (tmp != NULL) {
|
if (tmp != NULL) {
|
||||||
b = loadGeneralFile(tmp->ptr, NULL, NO_REFERER, 0, NULL);
|
b = loadGeneralFile(tmp->ptr, NULL, NO_REFERER, 0, request);
|
||||||
if (b != NO_BUFFER)
|
if (b != NO_BUFFER)
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-5
@@ -1,6 +1,6 @@
|
|||||||
#!@PERL@
|
#!@PERL@
|
||||||
|
|
||||||
$rcsid = q$Id: w3mmail.cgi.in,v 1.8 2002/01/29 16:31:09 ukai Exp $;
|
$rcsid = q$Id: w3mmail.cgi.in,v 1.9 2002/01/29 17:16:35 ukai Exp $;
|
||||||
($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/;
|
($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/;
|
||||||
($prog=$0) =~ s/.*\///;
|
($prog=$0) =~ s/.*\///;
|
||||||
|
|
||||||
@@ -25,8 +25,16 @@ if ($query =~ s/^\w+://) {
|
|||||||
@to = ($to);
|
@to = ($to);
|
||||||
push(@to, $opt{'to'}) if ($opt{'to'});
|
push(@to, $opt{'to'}) if ($opt{'to'});
|
||||||
$opt{'to'} = join(',', @to);
|
$opt{'to'} = join(',', @to);
|
||||||
$body = $opt{'body'};
|
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
|
||||||
delete $opt{'body'};
|
sysread(STDIN, $body, $ENV{'CONTENT_LENGTH'});
|
||||||
|
$content_type = $ENV{'CONTENT_TYPE'};
|
||||||
|
if ($content_type =~ /^multipart\/form-data;\s+boundary=(.*)$/) {
|
||||||
|
$boundary = $1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$body = $opt{'body'};
|
||||||
|
delete $opt{'body'};
|
||||||
|
}
|
||||||
&lang_setup;
|
&lang_setup;
|
||||||
|
|
||||||
print "Content-Type: text/html\r\n";
|
print "Content-Type: text/html\r\n";
|
||||||
@@ -49,6 +57,10 @@ if ($query =~ s/^\w+://) {
|
|||||||
print "<tr><td>\u$h:<td><input type='text' name=\"$h\" value=\"$v\">\n";
|
print "<tr><td>\u$h:<td><input type='text' name=\"$h\" value=\"$v\">\n";
|
||||||
delete $opt{$h};
|
delete $opt{$h};
|
||||||
}
|
}
|
||||||
|
if ($boundary) {
|
||||||
|
print "<tr><td>Content-Type:<td>multipart/form-data; boundary=\"$boundary\"\n";
|
||||||
|
print "<input type='hidden' name='boundary' value=\"$boundary\">\n";
|
||||||
|
}
|
||||||
foreach $h (keys %opt) {
|
foreach $h (keys %opt) {
|
||||||
$qh = &html_quote($h);
|
$qh = &html_quote($h);
|
||||||
$v = &lang_html_quote($opt{$h});
|
$v = &lang_html_quote($opt{$h});
|
||||||
@@ -80,6 +92,8 @@ if ($query =~ s/^\w+://) {
|
|||||||
delete $opt{'body'};
|
delete $opt{'body'};
|
||||||
$act = $opt{'action'};
|
$act = $opt{'action'};
|
||||||
delete $opt{'action'};
|
delete $opt{'action'};
|
||||||
|
$boundary = $opt{'boundary'};
|
||||||
|
delete $opt{'boundary'};
|
||||||
&lang_setup;
|
&lang_setup;
|
||||||
|
|
||||||
if ($act eq "Preview") {
|
if ($act eq "Preview") {
|
||||||
@@ -103,7 +117,12 @@ if ($query =~ s/^\w+://) {
|
|||||||
}
|
}
|
||||||
($cs,$cte,$body) = &lang_body(&lang_html_quote($body), 0);
|
($cs,$cte,$body) = &lang_body(&lang_html_quote($body), 0);
|
||||||
print "Mime-Version: 1.0\n";
|
print "Mime-Version: 1.0\n";
|
||||||
print "Content-Type: text/plain; charset=$cs\n";
|
if ($boundary) {
|
||||||
|
print "Content-Type: multipart/form-data;\n";
|
||||||
|
print " boundary=\"$boundary\"\n";
|
||||||
|
} else {
|
||||||
|
print "Content-Type: text/plain; charset=$cs\n";
|
||||||
|
}
|
||||||
# print "Content-Transfer-Encoding: $cte\n";
|
# print "Content-Transfer-Encoding: $cte\n";
|
||||||
print "User-Agent: $ENV{'SERVER_SOFTWARE'} $prog/$id\n";
|
print "User-Agent: $ENV{'SERVER_SOFTWARE'} $prog/$id\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
@@ -122,6 +141,10 @@ if ($query =~ s/^\w+://) {
|
|||||||
print "<tr><td>\u$h:<td><input type='text' name=\"$h\" value=\"$v{$h}\">\n";
|
print "<tr><td>\u$h:<td><input type='text' name=\"$h\" value=\"$v{$h}\">\n";
|
||||||
delete $opt{$h};
|
delete $opt{$h};
|
||||||
}
|
}
|
||||||
|
if ($boundary) {
|
||||||
|
print "<tr><td>Content-Type:<td>Content-Type: multipart/form-data; boundary=\"$boundary\"\n";
|
||||||
|
print "<input type='hidden' name=\"boundary\" value=\"$boundary\">\n";
|
||||||
|
}
|
||||||
foreach $h (keys %opt) {
|
foreach $h (keys %opt) {
|
||||||
$qh = &html_quote($h);
|
$qh = &html_quote($h);
|
||||||
print "<tr><td>\u$qh:<td>$v{$h}\n";
|
print "<tr><td>\u$qh:<td>$v{$h}\n";
|
||||||
@@ -154,7 +177,12 @@ if ($query =~ s/^\w+://) {
|
|||||||
}
|
}
|
||||||
($cs,$cte,$body) = &lang_body($body, 1);
|
($cs,$cte,$body) = &lang_body($body, 1);
|
||||||
print MAIL "Mime-Version: 1.0\n";
|
print MAIL "Mime-Version: 1.0\n";
|
||||||
print MAIL "Content-Type: text/plain; charset=$cs\n";
|
if ($boundary) {
|
||||||
|
print MAIL "Content-Type: multipart/form-data;\n";
|
||||||
|
print MAIL " boundary=\"$boundary\"\n";
|
||||||
|
} else {
|
||||||
|
print MAIL "Content-Type: text/plain; charset=$cs\n";
|
||||||
|
}
|
||||||
print MAIL "Content-Transfer-Encoding: $cte\n";
|
print MAIL "Content-Transfer-Encoding: $cte\n";
|
||||||
print MAIL "User-Agent: $ENV{'SERVER_SOFTWARE'} $prog/$id\n";
|
print MAIL "User-Agent: $ENV{'SERVER_SOFTWARE'} $prog/$id\n";
|
||||||
print MAIL "\n";
|
print MAIL "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user