84 |
$d->{security} = $tags_security->{$_}; |
$d->{security} = $tags_security->{$_}; |
85 |
push @{ $json->{tags} }, $d; |
push @{ $json->{tags} }, $d; |
86 |
} keys %$tags; |
} keys %$tags; |
87 |
print $client "HTTP/1.0 200 OK\r\nContent-Type: application/x-javascript\r\n\r\n", |
print $client "HTTP/1.0 200 OK\r\nContent-Type: application/json\r\n\r\n", |
88 |
$param->{callback}, "(", to_json($json), ")\r\n"; |
$param->{callback}, "(", to_json($json), ")\r\n"; |
89 |
} elsif ( $method =~ m{/program} ) { |
} elsif ( $method =~ m{/program} ) { |
90 |
|
|
104 |
|
|
105 |
print $client "HTTP/1.0 $status $method\r\nLocation: $server_url\r\n\r\n"; |
print $client "HTTP/1.0 $status $method\r\nLocation: $server_url\r\n\r\n"; |
106 |
|
|
107 |
} elsif ( $method =~ m{/secure} ) { |
} elsif ( $method =~ m{/secure(.js)} ) { |
108 |
|
|
109 |
|
my $json = $1; |
110 |
|
|
111 |
my $status = 501; # Not implementd |
my $status = 501; # Not implementd |
112 |
|
|
120 |
secure_tag_with( $tag, $data ); |
secure_tag_with( $tag, $data ); |
121 |
} |
} |
122 |
|
|
123 |
print $client "HTTP/1.0 $status $method\r\nLocation: $server_url\r\n\r\n"; |
if ( $json ) { |
124 |
|
print $client "HTTP/1.0 200 OK\r\nContent-Type: application/json\r\n\r\n", |
125 |
|
$param->{callback}, "({ ok: 1 })\r\n"; |
126 |
|
} else { |
127 |
|
print $client "HTTP/1.0 $status $method\r\nLocation: $server_url\r\n\r\n"; |
128 |
|
} |
129 |
|
|
130 |
} else { |
} else { |
131 |
print $client "HTTP/1.0 404 Unkown method\r\n"; |
print $client "HTTP/1.0 404 Unkown method\r\n\r\n"; |
132 |
} |
} |
133 |
} else { |
} else { |
134 |
print $client "HTTP/1.0 500 No method\r\n"; |
print $client "HTTP/1.0 500 No method\r\n\r\n"; |
135 |
} |
} |
136 |
close $client; |
close $client; |
137 |
} |
} |