Closed Bug 1126315 Opened 5 years ago Closed 5 years ago

Add rewrite rule to htaccess to properly map BzAPI requests to the BzAPI compatibility extension path

Categories

(bugzilla.mozilla.org :: API, defect)

Production
x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: dkl, Assigned: dkl)

References

Details

Attachments

(1 file)

This bug is to implement the idea proposed in bug 1105122 comment 19 to allow /latest/, /1.2/, or /1.3/ requests to be remapped to /bzapi/ so that the requests use the BzAPI extension.

Currently the api-dev redirect is using the following logic to do the mapping:

if(
   string.startsWith( $path, "/latest/") ||
   string.startsWith( $path, "/1.3/") ||
   string.startsWith( $path, "/1.2/")
   ) {
   $newpath = string.regexsub( $path, "^/(latest|1.2|1.3)/", "/bzapi/" );
   http.setPath( $newpath );
   http.changesite( "https://bugzilla.mozilla.org" );
} else {
      connection.discard();
}

We can do similar on BMO directly in the htaccess file by adding the following line:

RewriteRule ^(latest|1\.2|1\.3)/(.*)$ bzapi/$1 [NE] 

The api-dev can just be redirected to BMO without the need to check the path before (bug 1098342).

Patch coming up

dkl
Attached patch 1126315_1.patchSplinter Review
Attachment #8555616 - Flags: review?(glob)
Comment on attachment 8555616 [details] [diff] [review]
1126315_1.patch

Review of attachment 8555616 [details] [diff] [review]:
-----------------------------------------------------------------

r=glob
Attachment #8555616 - Flags: review?(glob) → review+
Thanks!

To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   66ed543..a496214  master -> master
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.