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

Fix external trusted proxies env usage #1450

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

AndrewDryga
Copy link
Collaborator

@AndrewDryga AndrewDryga commented Feb 22, 2023

@AndrewDryga AndrewDryga added the kind/bug Something isn't working label Feb 22, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3d699c240ed22827bcd71f44917e04bd1748b6c9-PR-1450

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.08%) to 66.389%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/fz_http/lib/fz_http_web/header_helpers.ex 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
apps/fz_http/lib/fz_http_web/proxy_headers.ex 2 0%
Totals Coverage Status
Change from base Build cec02b13d37650b21728e379c6ac1fe9a2279a30: -0.08%
Covered Lines: 1671
Relevant Lines: 2517

💛 - Coveralls

@@ -9,12 +9,12 @@ defmodule FzHttpWeb.HeaderHelpers do

def clients, do: FzHttp.Config.fetch_env!(:fz_http, :private_clients)

def proxied?, do: not (external_trusted_proxies() == false)
def proxied?, do: external_trusted_proxies() != []
Copy link
Collaborator Author

@AndrewDryga AndrewDryga Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamilbk the old condition never returned false, because it was always comparing a list to a boolean: [] == false.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed this too. Thanks for the fix and test!

@@ -9,12 +9,12 @@ defmodule FzHttpWeb.HeaderHelpers do

def clients, do: FzHttp.Config.fetch_env!(:fz_http, :private_clients)

def proxied?, do: not (external_trusted_proxies() == false)
def proxied?, do: external_trusted_proxies() != []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed this too. Thanks for the fix and test!

@AndrewDryga AndrewDryga merged commit ae23fbf into master Feb 22, 2023
@AndrewDryga AndrewDryga deleted the andrew/fix-external-trusted-proxies-env branch February 22, 2023 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants