Skip to content

Fix hostname returned when multiple host aliases are defined #250

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

Merged
merged 1 commit into from
Jun 2, 2022
Merged

Fix hostname returned when multiple host aliases are defined #250

merged 1 commit into from
Jun 2, 2022

Conversation

h3xx
Copy link
Contributor

@h3xx h3xx commented Jun 1, 2022

Hosts with multiple aliases were returning invalid hostnames.

For example, given config:

Host foo bar baz
  HostName 127.0.0.1

When running ->findConfiguredHost('127.0.0.1'), 'foo bar baz' was getting returned which is invalid. With this change, the hostname returned will be 'foo' (valid).

Also updated tests.

Fixes #230

For example, given config:

Host foo bar baz
  HostName 127.0.0.1

The hostname returned will return 'foo' instead of 'foo bar baz'
(invalid).

Fixes #230
@h3xx h3xx changed the title Fix hostname returned when multiple host aliases are defined WIP: Fix hostname returned when multiple host aliases are defined Jun 1, 2022
@h3xx
Copy link
Contributor Author

h3xx commented Jun 1, 2022

Hold on, I found an edge case.

Edit: Nevermind, I didn't introduce the edge case. Asking it for 'bar' in my example would produce null, but it did that before my change. Maybe that's by design.

@h3xx h3xx changed the title WIP: Fix hostname returned when multiple host aliases are defined Fix hostname returned when multiple host aliases are defined Jun 1, 2022
@taylorotwell taylorotwell merged commit 8d274a9 into laravel:2.x Jun 2, 2022
@h3xx h3xx deleted the fix-multiple-host-aliases branch June 2, 2022 15:11
pgrenaud pushed a commit to eXolnet/envoy that referenced this pull request Jul 19, 2023
…#250)

For example, given config:

Host foo bar baz
  HostName 127.0.0.1

The hostname returned will return 'foo' instead of 'foo bar baz'
(invalid).

Fixes laravel#230

(cherry picked from commit 8d274a9)
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.

Multiple host patterns
2 participants