Fix a regression in URLs in WebHook payloads.

Review Request #11670 — Created June 23, 2021 and submitted

Information

Review Board
release-4.0.x

Reviewers

WebHook payloads make use of a custom version of Django's HttpRequest
object to simulate API responses from a request. As part of this, we
attempt to calculate state needed by HttpRequest.build_absolute_uri()
to generate a suitable URL.

This regressed with the move to Django 1.11, as the logic for
determining the scheme (HTTP or HTTPS) for URLs had changed, and our
test coverage didn't check for this.

This change update our version of this object to provide the correct
state, and adds unit tests to ensure this won't regress in the future.
The tests also check to make sure the site domain is reflected in URLs.

Unit tests pass on Python 2 and 3.

Summary ID
Fix a regression in URLs in WebHook payloads.
WebHook payloads make use of a custom version of Django's `HttpRequest` object to simulate API responses from a request. As part of this, we attempt to calculate state needed by `HttpRequest.build_absolute_uri()` to generate a suitable URL. This regressed with the move to Django 1.11, as the logic for determining the scheme (HTTP or HTTPS) for URLs had changed, and our test coverage didn't check for this. This change update our version of this object to provide the correct state, and adds unit tests to ensure this won't regress in the future. The tests also check to make sure the site domain is reflected in URLs.
30d9c925779730431ed8fe3977da7d8ede2bd151
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (d9f41a3)
Loading...