Skip to content

Commit e2947c5

Browse files
authored
Merge pull request #3 from metacpan/leo/create_api_for_fallback
Rename /report (for back compat) to /api/old_format_reports...
2 parents e68d38f + 08793a9 commit e2947c5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/Perl5/CoreSmokeDB/API/FreeRoutes.pm

+7-2
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,19 @@ get '/api/openapi/web' => sub {
6666
return $yaml;
6767
};
6868

69-
=head2 POST B</report>
69+
=head2 POST B</api/old_format_reports>
7070
7171
This is a backward compatible endpoint that allows old clients to keep working.
7272
It uses the global variable C<$::web_api> to access the new API.
7373
74+
Fastly CDN will redirect /report to /api/old_format_reports.
75+
76+
We need `/api` in the path so the k8 Ingest knows to sent to the correct
77+
container.
78+
7479
=cut
7580

76-
post '/report' => sub {
81+
post '/api/old_format_reports' => sub {
7782
my $start = time();
7883
my $data = from_json(encode('utf-8', params->{json}), { utf8 => 1 });
7984

t/150-post-report.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ $schema->txn_do(
5757

5858
$schema->txn_do(
5959
sub {
60-
note("Backward compatibility: POST /report");
60+
note("Backward compatibility: POST /api/old_format_reports");
6161
my $response = $tester->request(
6262
HTTP::Request->new(
63-
POST => '/report',
63+
POST => '/api/old_format_reports',
6464
[ 'Content-type' => 'application/x-www-form-urlencoded' ],
6565
join("=", map {uri_escape($_) } "json", $jsn_rpt)
6666
)

0 commit comments

Comments
 (0)