Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy fix header handling for X-Forwarded-For etc. #1085

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

alexgleith
Copy link
Contributor

@alexgleith alexgleith commented Nov 13, 2024

This is a low-risk and high-reward feature that adds another environment variable that turns on the "proxy_fix" middleware, which ensures the app understands what URLs it should return as part of the getCaps and other responses.

Tested in production for DE Pacific.


📚 Documentation preview 📚: https://datacube-ows--1085.org.readthedocs.build/en/1085/

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 93.28%. Comparing base (5a0fbf4) to head (f298a2e).
Report is 10 commits behind head on develop-1.9.

Files with missing lines Patch % Lines
datacube_ows/startup_utils.py 42.85% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           develop-1.9    #1085      +/-   ##
===============================================
- Coverage        93.33%   93.28%   -0.05%     
===============================================
  Files               53       53              
  Lines             7032     7040       +8     
===============================================
+ Hits              6563     6567       +4     
- Misses             469      473       +4     
Files with missing lines Coverage Δ
datacube_ows/feature_info.py 90.54% <100.00%> (ø)
datacube_ows/ogc.py 86.13% <100.00%> (+0.10%) ⬆️
datacube_ows/startup_utils.py 90.32% <42.85%> (-2.25%) ⬇️

@alexgleith alexgleith merged commit ac96360 into develop-1.9 Nov 13, 2024
10 checks passed
@alexgleith alexgleith deleted the add-proxy-fix-middleware-option branch November 13, 2024 04:41
@pjonsson
Copy link
Contributor

@alexgleith if I understand your description, GetCapabilities will return broken results without this. Does this already work for the main branch, or should this commit also be merged there?

@alexgleith
Copy link
Contributor Author

Hey @pjonsson this was merged into the main branch too.

@pjonsson
Copy link
Contributor

@alexgleith are you sure about that? If I git grep PROXY_FIX on latest master, I get no hits.

@alexgleith
Copy link
Contributor Author

@alexgleith are you sure about that?

Nope, not sure! I think it must have been the other fix about cache-control headers that was merged into both.

Happy to review a PR that adds this to the 1.8 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants