forked from leogopal/b2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsproxy.pl
More file actions
41 lines (35 loc) · 666 Bytes
/
Copy pathsproxy.pl
File metadata and controls
41 lines (35 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl
print "Content-type: text/html\n\n";
if ($ENV{'REQUEST_METHOD'} ne 'POST')
{
print <<"HTML";
<HTML>
<BODY>
only method POST is supported here.
</BODY>
</HTML>
HTML
exit;
}
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
print $value;
if($name eq "f")
{
print "<textarea name=TextBox1>"
}
if($name eq "g")
{
print "</textarea><textarea name=TextBox2>"
}
if($name eq "h")
{
print "</textarea>"
}
}
exit;