PowerShell / Polaris

A cross-platform, minimalist web framework for PowerShell
https://powershell.github.io/Polaris/
MIT License
512 stars 114 forks source link

Added Hostname Support for Specific Bindings #175

Closed jeremymcgee73 closed 5 years ago

jeremymcgee73 commented 5 years ago

Pull Request Creation Checklist

I added a hostname parameter as requested from issue #156. This allows the binding to be for a more specific hostname. Before the behavior on Linux/OSX or running on Windows as admin, we used the wildcard + as the binding. If it was ran as non-admin on Windows we used localhost as the binding. Now, we are defaulting to localhost, and allowing users to set the hostname as needed. There are also security concerns with defaulting to the wildcard. This fixes #156.

jeremymcgee73 commented 5 years ago

@TylerLeonhardt Can we edit the host file on the machines that run the test? We would need to create hostnames/DNS records, that the client could resolve. We could test localhost, 127.0.0.1 and + without any changes to the machine.

TylerLeonhardt commented 5 years ago

I think testing localhost, 127.0.0.1, and + is a good enough test case to ensure that specifying Hostname doesn't break anything.

It could yield false positives... But modifying host files xplat sounds annoying so I'm fine with just the localhost testing 👍

jeremymcgee73 commented 5 years ago

Tests have been added! Let me know if you need anything else. @TylerLeonhardt