Skip to content

Fixed incorrect URL generation in bootstrap API endpoint that server config files#599

Merged
tieneupin merged 5 commits intomainfrom
fix-bootstrap-urls
Jun 5, 2025
Merged

Fixed incorrect URL generation in bootstrap API endpoint that server config files#599
tieneupin merged 5 commits intomainfrom
fix-bootstrap-urls

Conversation

@tieneupin
Copy link
Contributor

@tieneupin tieneupin commented May 29, 2025

The logic for constructing URL paths when accessing the server through an Ingress is currently faulty, leading to the creation of invalid URLs. This PR resolves this issue (as mentioned in Issue #597 ) by adding a function to construct the netloc properly by parsing the request headers before defaulting to parsing the Request object's properties. This allows for valid URLs to be generated for a range of server configurations:

  1. behind an NGINX server and accessed via Ingress
  2. behind an NGINX server and accessed via LoadBalancer IP address
  3. by itself and accessed directly

Additionally, the URL generation logic in the HTML files we serve was optimised so that they work with the various server configurations listed above. Redundant HTML files have also been removed.

NOTE: This PR necesitates a change in the NGINX config so that the correct headers are forwarded to the backend.

…defaulting to parsing the Request object's properties
@tieneupin tieneupin self-assigned this May 29, 2025
@tieneupin tieneupin added bug Something isn't working server Relates to the server component labels May 29, 2025
@tieneupin tieneupin linked an issue May 29, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 23.07692% with 10 lines in your changes missing coverage. Please review.

Project coverage is 31.72%. Comparing base (2d3e030) to head (56b3a94).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #599      +/-   ##
==========================================
- Coverage   31.77%   31.72%   -0.06%     
==========================================
  Files          90       90              
  Lines       10700    10703       +3     
  Branches     1422     1423       +1     
==========================================
- Hits         3400     3395       -5     
- Misses       7187     7196       +9     
+ Partials      113      112       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tieneupin added 2 commits May 30, 2025 15:39
…ead; allows correct URL generation when server is behind NGINX server and accessed via Ingress or LoadBalancer, and when server is standalone
@tieneupin tieneupin requested a review from d-j-hatton May 30, 2025 14:42
@tieneupin tieneupin merged commit d64446c into main Jun 5, 2025
17 checks passed
@tieneupin tieneupin deleted the fix-bootstrap-urls branch June 5, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server Relates to the server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bootstrap URL parsing logic will need to be revisited

2 participants