1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10:08 +02:00

Correctly detect secured proxies

This commit is contained in:
2022-04-12 20:43:57 +02:00
parent 1b8d6311ba
commit 2c0c0c5a11
7 changed files with 79 additions and 2 deletions

View File

@ -22,6 +22,10 @@ class NginxConfigurationTest: XCTestCase {
return Bundle(for: Self.self).url(forResource: "nginx-proxy", withExtension: "test")!
}
static var secureProxyUrl: URL {
return Bundle(for: Self.self).url(forResource: "nginx-secure-proxy", withExtension: "test")!
}
func testCanDetermineSiteNameAndTld() throws {
XCTAssertEqual(
"nginx-site",
@ -54,4 +58,10 @@ class NginxConfigurationTest: XCTestCase {
XCTAssertEqual(nil, normal.proxy)
}
func testCanDetermineSecuredProxy() throws {
let proxied = NginxConfiguration(filePath: NginxConfigurationTest.secureProxyUrl.path)
XCTAssertTrue(proxied.contents.contains("# valet stub: secure.proxy.valet.conf"))
XCTAssertEqual("http://127.0.0.1:90", proxied.proxy)
}
}