Skip to content

Commit

Permalink
add a doc comment explaining the REWRITE_ stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanwh committed Sep 3, 2023
1 parent b225ae9 commit f8eeb9d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions extensions/BMO/Extension.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2797,6 +2797,17 @@ sub app_startup {
}
);

# In previous versions of bugzilla, an .htaccess file was used to redirect
# urls (often in the form of form:name or form.name) to different .cgi
# endpoints.
#
# Since the port to Mojolicious, we do this by adding additional routes.
# This is accomplished with a placeholder that we consistently prefix with
# REWRITE_, and as you can see below is followed by an arrayref mapping the
# (arbitrary) name to a regular expression and a destination.
#
# The REWRITE_ prefix is only significant because it is removed from the fake
# CGI environment in Bugzilla::App::CGI
$r->any('/:REWRITE_itrequest' => [REWRITE_itrequest => qr{form[\.:]itrequest}])
->to('CGI#enter_bug_cgi' =>
{'product' => 'Infrastructure & Operations', 'format' => 'itrequest'});
Expand Down

0 comments on commit f8eeb9d

Please sign in to comment.