From 199cd5f9dad39ec62534b232fbad6252db26a1dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:28:58 +0000 Subject: [PATCH 01/10] Initial plan From 1f8129dee3b701930ba995fb6b9d88d8c06727e4 Mon Sep 17 00:00:00 2001 From: Copilot Date: Sun, 25 Jan 2026 18:31:23 +0000 Subject: [PATCH 02/10] Apply cfformat changes --- models/HyperRequest.cfc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index 58cb7fd..5b81af7 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -1110,7 +1110,10 @@ component accessors="true" { callback( res ); } - param variables.useAnnounceMethodForInterceptorService = structKeyExists( variables.interceptorService, "announce" ); + param variables.useAnnounceMethodForInterceptorService = structKeyExists( + variables.interceptorService, + "announce" + ); if ( variables.useAnnounceMethodForInterceptorService ) { variables.interceptorService.announce( "onHyperResponse", From a902729eea18c189a321ecf1c65cb7ba8a1846fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:33:02 +0000 Subject: [PATCH 03/10] Add proxy support to HyperRequest and CfhttpHttpClient Co-authored-by: elpete <2583646+elpete@users.noreply.github.com> --- models/CfhttpHttpClient.cfc | 32 ++++++++++++++++++++++ models/HyperRequest.cfc | 53 +++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/models/CfhttpHttpClient.cfc b/models/CfhttpHttpClient.cfc index 94d338b..8286eba 100644 --- a/models/CfhttpHttpClient.cfc +++ b/models/CfhttpHttpClient.cfc @@ -89,6 +89,22 @@ component implements="HyperHttpClientInterface" { attrCollection[ "clientCertPassword" ] = req.getClientCertPassword(); } + if ( len( req.getProxyServer() ) ) { + attrCollection[ "proxyServer" ] = req.getProxyServer(); + } + + if ( len( req.getProxyPort() ) ) { + attrCollection[ "proxyPort" ] = req.getProxyPort(); + } + + if ( len( req.getProxyUser() ) ) { + attrCollection[ "proxyUser" ] = req.getProxyUser(); + } + + if ( len( req.getProxyPassword() ) ) { + attrCollection[ "proxyPassword" ] = req.getProxyPassword(); + } + var cfhttpHeaders = []; var headers = req.getHeaders(); for ( var name in headers ) { @@ -235,6 +251,22 @@ component implements="HyperHttpClientInterface" { attrCollection[ "clientCertPassword" ] = req.getClientCertPassword(); } + if ( len( req.getProxyServer() ) ) { + attrCollection[ "proxyServer" ] = req.getProxyServer(); + } + + if ( len( req.getProxyPort() ) ) { + attrCollection[ "proxyPort" ] = req.getProxyPort(); + } + + if ( len( req.getProxyUser() ) ) { + attrCollection[ "proxyUser" ] = req.getProxyUser(); + } + + if ( len( req.getProxyPassword() ) ) { + attrCollection[ "proxyPassword" ] = req.getProxyPassword(); + } + cfhttp( attributeCollection = attrCollection ) { var headers = req.getHeaders(); for ( var name in headers ) { diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index 5b81af7..a7bb660 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -186,6 +186,26 @@ component accessors="true" { */ property name="preventStrayRequests" type="boolean"; + /** + * The proxy server for the request. + */ + property name="proxyServer" default=""; + + /** + * The proxy port for the request. + */ + property name="proxyPort" default="80"; + + /** + * The proxy user for the request. + */ + property name="proxyUser" default=""; + + /** + * The proxy password for the request. + */ + property name="proxyPassword" default=""; + /** * A reference to the HyperBuilder that created this request, if any. */ @@ -840,6 +860,29 @@ component accessors="true" { return this; } + /** + * Sets the proxy settings for the request. + * + * @proxyHost The proxy server host or IP address. + * @proxyUser The username for proxy authentication. + * @proxyPassword The password for proxy authentication. + * @proxyPort The proxy server port. Defaults to 80. + * + * @returns The HyperRequest instance. + */ + function throughProxy( + required string proxyHost, + required string proxyUser, + required string proxyPassword, + numeric proxyPort = 80 + ) { + setProxyServer( arguments.proxyHost ); + setProxyUser( arguments.proxyUser ); + setProxyPassword( arguments.proxyPassword ); + setProxyPort( arguments.proxyPort ); + return this; + } + /** * Schedules a callback to be ran when executing the request. * @@ -1314,6 +1357,10 @@ component accessors="true" { req.setDomain( variables.domain ); req.setWorkstation( variables.workstation ); req.setAuthType( variables.authType ); + req.setProxyServer( variables.proxyServer ); + req.setProxyPort( variables.proxyPort ); + req.setProxyUser( variables.proxyUser ); + req.setProxyPassword( variables.proxyPassword ); req.setRequestCallbacks( duplicate( variables.requestCallbacks ) ); req.setResponseCallbacks( duplicate( variables.responseCallbacks ) ); req.setRetries( duplicate( getRetries() ) ); @@ -1454,6 +1501,12 @@ component accessors="true" { "clientCertPassword" : isNull( variables.clientCertPassword ) ? "" : variables.clientCertPassword, "domain" : getDomain(), "workstation" : getWorkstation(), + "proxy" : { + "proxyServer" : getProxyServer(), + "proxyPort" : getProxyPort(), + "proxyUser" : getProxyUser(), + "proxyPassword" : getProxyPassword() + }, "resolveUrls" : getResolveUrls(), "encodeUrl" : getEncodeUrl(), "retries" : getRetries(), From 4a98df1f8ffdbb20082782f61531cf8eef5d9a09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:34:42 +0000 Subject: [PATCH 04/10] Add comprehensive tests for proxy settings Co-authored-by: elpete <2583646+elpete@users.noreply.github.com> --- tests/specs/integration/DebugSpec.cfc | 24 ++++++++++ tests/specs/unit/HyperRequestSpec.cfc | 67 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/tests/specs/integration/DebugSpec.cfc b/tests/specs/integration/DebugSpec.cfc index dd62d49..ccf511f 100644 --- a/tests/specs/integration/DebugSpec.cfc +++ b/tests/specs/integration/DebugSpec.cfc @@ -79,6 +79,30 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" { expect( headers[ 4 ] ).toHaveKey( "value" ); expect( headers[ 4 ].value ).toBe( "HyperCFML/#req.getHyperVersion()#" ); } ); + + it( "includes proxy settings in debug output", function() { + var req = hyper + .setUrl( "https://example.com" ) + .throughProxy( + proxyHost = "proxy.example.com", + proxyUser = "proxyuser", + proxyPassword = "proxypass", + proxyPort = 8080 + ); + + var debugReq = req.debug(); + + expect( debugReq ).toBeStruct(); + expect( debugReq ).toHaveKey( "attributes" ); + expect( debugReq.attributes ).toHaveKey( "proxyServer" ); + expect( debugReq.attributes.proxyServer ).toBe( "proxy.example.com" ); + expect( debugReq.attributes ).toHaveKey( "proxyPort" ); + expect( debugReq.attributes.proxyPort ).toBe( 8080 ); + expect( debugReq.attributes ).toHaveKey( "proxyUser" ); + expect( debugReq.attributes.proxyUser ).toBe( "proxyuser" ); + expect( debugReq.attributes ).toHaveKey( "proxyPassword" ); + expect( debugReq.attributes.proxyPassword ).toBe( "proxypass" ); + } ); } ); } diff --git a/tests/specs/unit/HyperRequestSpec.cfc b/tests/specs/unit/HyperRequestSpec.cfc index c17d04a..36f8c4b 100644 --- a/tests/specs/unit/HyperRequestSpec.cfc +++ b/tests/specs/unit/HyperRequestSpec.cfc @@ -36,6 +36,12 @@ component extends="testbox.system.BaseSpec" { "clientCertPassword" : "", "domain" : variables.req.getDomain(), "workstation" : variables.req.getWorkstation(), + "proxy" : { + "proxyServer" : variables.req.getProxyServer(), + "proxyPort" : variables.req.getProxyPort(), + "proxyUser" : variables.req.getProxyUser(), + "proxyPassword" : variables.req.getProxyPassword() + }, "resolveUrls" : variables.req.getResolveUrls(), "encodeUrl" : variables.req.getEncodeUrl(), "retries" : variables.req.getRetries(), @@ -166,6 +172,67 @@ component extends="testbox.system.BaseSpec" { expect( req.getClientCertPassword() ).toBe( "mypassword" ); } ); + it( "can set proxy settings via throughProxy method", function() { + expect( req.getProxyServer() ).toBe( "" ); + expect( req.getProxyPort() ).toBe( 80 ); + expect( req.getProxyUser() ).toBe( "" ); + expect( req.getProxyPassword() ).toBe( "" ); + req.throughProxy( + proxyHost = "proxy.example.com", + proxyUser = "proxyuser", + proxyPassword = "proxypass", + proxyPort = 8080 + ); + expect( req.getProxyServer() ).toBe( "proxy.example.com" ); + expect( req.getProxyPort() ).toBe( 8080 ); + expect( req.getProxyUser() ).toBe( "proxyuser" ); + expect( req.getProxyPassword() ).toBe( "proxypass" ); + } ); + + it( "can set proxy settings with default port", function() { + expect( req.getProxyPort() ).toBe( 80 ); + req.throughProxy( + proxyHost = "proxy.example.com", + proxyUser = "proxyuser", + proxyPassword = "proxypass" + ); + expect( req.getProxyServer() ).toBe( "proxy.example.com" ); + expect( req.getProxyPort() ).toBe( 80 ); + expect( req.getProxyUser() ).toBe( "proxyuser" ); + expect( req.getProxyPassword() ).toBe( "proxypass" ); + } ); + + it( "includes proxy settings in memento", function() { + req.throughProxy( + proxyHost = "proxy.example.com", + proxyUser = "proxyuser", + proxyPassword = "proxypass", + proxyPort = 8080 + ); + var memento = req.getMemento(); + expect( memento ).toHaveKey( "proxy" ); + expect( memento.proxy ).toBe( { + "proxyServer" : "proxy.example.com", + "proxyPort" : 8080, + "proxyUser" : "proxyuser", + "proxyPassword" : "proxypass" + } ); + } ); + + it( "clones proxy settings to new request", function() { + req.throughProxy( + proxyHost = "proxy.example.com", + proxyUser = "proxyuser", + proxyPassword = "proxypass", + proxyPort = 8080 + ); + var clonedReq = req.clone(); + expect( clonedReq.getProxyServer() ).toBe( "proxy.example.com" ); + expect( clonedReq.getProxyPort() ).toBe( 8080 ); + expect( clonedReq.getProxyUser() ).toBe( "proxyuser" ); + expect( clonedReq.getProxyPassword() ).toBe( "proxypass" ); + } ); + it( "can define onRequest callback hooks", function() { var method = "not set yet"; var headers = {}; From d08ce7f73bc6c827e3a363cbcb994f578159c7ff Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:36:30 +0000 Subject: [PATCH 05/10] Fix proxy port handling to avoid len() on numeric value Co-authored-by: elpete <2583646+elpete@users.noreply.github.com> --- models/CfhttpHttpClient.cfc | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/models/CfhttpHttpClient.cfc b/models/CfhttpHttpClient.cfc index 8286eba..a2d250a 100644 --- a/models/CfhttpHttpClient.cfc +++ b/models/CfhttpHttpClient.cfc @@ -91,18 +91,15 @@ component implements="HyperHttpClientInterface" { if ( len( req.getProxyServer() ) ) { attrCollection[ "proxyServer" ] = req.getProxyServer(); - } - - if ( len( req.getProxyPort() ) ) { attrCollection[ "proxyPort" ] = req.getProxyPort(); - } - - if ( len( req.getProxyUser() ) ) { - attrCollection[ "proxyUser" ] = req.getProxyUser(); - } + + if ( len( req.getProxyUser() ) ) { + attrCollection[ "proxyUser" ] = req.getProxyUser(); + } - if ( len( req.getProxyPassword() ) ) { - attrCollection[ "proxyPassword" ] = req.getProxyPassword(); + if ( len( req.getProxyPassword() ) ) { + attrCollection[ "proxyPassword" ] = req.getProxyPassword(); + } } var cfhttpHeaders = []; @@ -253,18 +250,15 @@ component implements="HyperHttpClientInterface" { if ( len( req.getProxyServer() ) ) { attrCollection[ "proxyServer" ] = req.getProxyServer(); - } - - if ( len( req.getProxyPort() ) ) { attrCollection[ "proxyPort" ] = req.getProxyPort(); - } - - if ( len( req.getProxyUser() ) ) { - attrCollection[ "proxyUser" ] = req.getProxyUser(); - } + + if ( len( req.getProxyUser() ) ) { + attrCollection[ "proxyUser" ] = req.getProxyUser(); + } - if ( len( req.getProxyPassword() ) ) { - attrCollection[ "proxyPassword" ] = req.getProxyPassword(); + if ( len( req.getProxyPassword() ) ) { + attrCollection[ "proxyPassword" ] = req.getProxyPassword(); + } } cfhttp( attributeCollection = attrCollection ) { From df9f3996e3223cd699fba864614779caeaef291a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:37:26 +0000 Subject: [PATCH 06/10] Remove trailing whitespace for code style consistency Co-authored-by: elpete <2583646+elpete@users.noreply.github.com> --- models/CfhttpHttpClient.cfc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/CfhttpHttpClient.cfc b/models/CfhttpHttpClient.cfc index a2d250a..1a9f312 100644 --- a/models/CfhttpHttpClient.cfc +++ b/models/CfhttpHttpClient.cfc @@ -92,7 +92,7 @@ component implements="HyperHttpClientInterface" { if ( len( req.getProxyServer() ) ) { attrCollection[ "proxyServer" ] = req.getProxyServer(); attrCollection[ "proxyPort" ] = req.getProxyPort(); - + if ( len( req.getProxyUser() ) ) { attrCollection[ "proxyUser" ] = req.getProxyUser(); } @@ -251,7 +251,7 @@ component implements="HyperHttpClientInterface" { if ( len( req.getProxyServer() ) ) { attrCollection[ "proxyServer" ] = req.getProxyServer(); attrCollection[ "proxyPort" ] = req.getProxyPort(); - + if ( len( req.getProxyUser() ) ) { attrCollection[ "proxyUser" ] = req.getProxyUser(); } From c8685587093fc223dcfc18bd3aedef320e23fb69 Mon Sep 17 00:00:00 2001 From: Copilot Date: Sun, 25 Jan 2026 18:40:51 +0000 Subject: [PATCH 07/10] Apply cfformat changes --- models/CfhttpHttpClient.cfc | 4 +-- models/HyperRequest.cfc | 46 +++++++++++++-------------- tests/specs/unit/HyperRequestSpec.cfc | 46 +++++++++++++-------------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/models/CfhttpHttpClient.cfc b/models/CfhttpHttpClient.cfc index 1a9f312..dce0261 100644 --- a/models/CfhttpHttpClient.cfc +++ b/models/CfhttpHttpClient.cfc @@ -91,7 +91,7 @@ component implements="HyperHttpClientInterface" { if ( len( req.getProxyServer() ) ) { attrCollection[ "proxyServer" ] = req.getProxyServer(); - attrCollection[ "proxyPort" ] = req.getProxyPort(); + attrCollection[ "proxyPort" ] = req.getProxyPort(); if ( len( req.getProxyUser() ) ) { attrCollection[ "proxyUser" ] = req.getProxyUser(); @@ -250,7 +250,7 @@ component implements="HyperHttpClientInterface" { if ( len( req.getProxyServer() ) ) { attrCollection[ "proxyServer" ] = req.getProxyServer(); - attrCollection[ "proxyPort" ] = req.getProxyPort(); + attrCollection[ "proxyPort" ] = req.getProxyPort(); if ( len( req.getProxyUser() ) ) { attrCollection[ "proxyUser" ] = req.getProxyUser(); diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index a7bb660..0f5eb5d 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -1479,29 +1479,29 @@ component accessors="true" { public struct function getMemento( array excludes = [] ) { return structFilter( { - "requestID" : getRequestID(), - "baseUrl" : getBaseUrl(), - "url" : getUrl(), - "fullUrl" : getFullUrl(), - "method" : getMethod(), - "queryParams" : getQueryParams(), - "headers" : getHeaders(), - "cookies" : getCookies(), - "files" : getFiles(), - "bodyFormat" : getBodyFormat(), - "body" : getBody(), - "referrerId" : isNull( variables.referrer ) ? "" : variables.referrer.getResponseID(), - "throwOnError" : getThrowOnError(), - "timeout" : getTimeout(), - "maximumRedirects" : getMaximumRedirects(), - "authType" : getAuthType(), - "username" : getUsername(), - "password" : getPassword(), - "clientCert" : isNull( variables.clientCert ) ? "" : variables.clientCert, - "clientCertPassword" : isNull( variables.clientCertPassword ) ? "" : variables.clientCertPassword, - "domain" : getDomain(), - "workstation" : getWorkstation(), - "proxy" : { + "requestID" : getRequestID(), + "baseUrl" : getBaseUrl(), + "url" : getUrl(), + "fullUrl" : getFullUrl(), + "method" : getMethod(), + "queryParams" : getQueryParams(), + "headers" : getHeaders(), + "cookies" : getCookies(), + "files" : getFiles(), + "bodyFormat" : getBodyFormat(), + "body" : getBody(), + "referrerId" : isNull( variables.referrer ) ? "" : variables.referrer.getResponseID(), + "throwOnError" : getThrowOnError(), + "timeout" : getTimeout(), + "maximumRedirects" : getMaximumRedirects(), + "authType" : getAuthType(), + "username" : getUsername(), + "password" : getPassword(), + "clientCert" : isNull( variables.clientCert ) ? "" : variables.clientCert, + "clientCertPassword" : isNull( variables.clientCertPassword ) ? "" : variables.clientCertPassword, + "domain" : getDomain(), + "workstation" : getWorkstation(), + "proxy" : { "proxyServer" : getProxyServer(), "proxyPort" : getProxyPort(), "proxyUser" : getProxyUser(), diff --git a/tests/specs/unit/HyperRequestSpec.cfc b/tests/specs/unit/HyperRequestSpec.cfc index 36f8c4b..0b1fd14 100644 --- a/tests/specs/unit/HyperRequestSpec.cfc +++ b/tests/specs/unit/HyperRequestSpec.cfc @@ -14,29 +14,29 @@ component extends="testbox.system.BaseSpec" { it( "can serialize to a memento", function() { expect( variables.req.getMemento() ).toBe( { - "requestID" : variables.req.getRequestID(), - "baseUrl" : variables.req.getBaseUrl(), - "url" : variables.req.getUrl(), - "fullUrl" : variables.req.getFullUrl(), - "method" : variables.req.getMethod(), - "queryParams" : variables.req.getQueryParams(), - "headers" : variables.req.getHeaders(), - "cookies" : variables.req.getCookies(), - "files" : variables.req.getFiles(), - "bodyFormat" : variables.req.getBodyFormat(), - "body" : variables.req.getBody(), - "referrerId" : "", - "throwOnError" : variables.req.getThrowOnError(), - "timeout" : variables.req.getTimeout(), - "maximumRedirects" : variables.req.getMaximumRedirects(), - "authType" : variables.req.getAuthType(), - "username" : variables.req.getUsername(), - "password" : variables.req.getPassword(), - "clientCert" : "", - "clientCertPassword" : "", - "domain" : variables.req.getDomain(), - "workstation" : variables.req.getWorkstation(), - "proxy" : { + "requestID" : variables.req.getRequestID(), + "baseUrl" : variables.req.getBaseUrl(), + "url" : variables.req.getUrl(), + "fullUrl" : variables.req.getFullUrl(), + "method" : variables.req.getMethod(), + "queryParams" : variables.req.getQueryParams(), + "headers" : variables.req.getHeaders(), + "cookies" : variables.req.getCookies(), + "files" : variables.req.getFiles(), + "bodyFormat" : variables.req.getBodyFormat(), + "body" : variables.req.getBody(), + "referrerId" : "", + "throwOnError" : variables.req.getThrowOnError(), + "timeout" : variables.req.getTimeout(), + "maximumRedirects" : variables.req.getMaximumRedirects(), + "authType" : variables.req.getAuthType(), + "username" : variables.req.getUsername(), + "password" : variables.req.getPassword(), + "clientCert" : "", + "clientCertPassword" : "", + "domain" : variables.req.getDomain(), + "workstation" : variables.req.getWorkstation(), + "proxy" : { "proxyServer" : variables.req.getProxyServer(), "proxyPort" : variables.req.getProxyPort(), "proxyUser" : variables.req.getProxyUser(), From 878deb655ebc0640829327e990dcff7f25442a1e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:44:45 +0000 Subject: [PATCH 08/10] Make proxyUser and proxyPassword optional parameters Reordered throughProxy() parameters so optional ones come after required: - proxyHost (required) - proxyPort (optional, default 80) - proxyUser (optional, default "") - proxyPassword (optional, default "") Added tests for proxy without authentication scenarios. Co-authored-by: elpete <2583646+elpete@users.noreply.github.com> --- models/HyperRequest.cfc | 10 +++++----- tests/specs/unit/HyperRequestSpec.cfc | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index 0f5eb5d..0347593 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -864,22 +864,22 @@ component accessors="true" { * Sets the proxy settings for the request. * * @proxyHost The proxy server host or IP address. + * @proxyPort The proxy server port. Defaults to 80. * @proxyUser The username for proxy authentication. * @proxyPassword The password for proxy authentication. - * @proxyPort The proxy server port. Defaults to 80. * * @returns The HyperRequest instance. */ function throughProxy( required string proxyHost, - required string proxyUser, - required string proxyPassword, - numeric proxyPort = 80 + numeric proxyPort = 80, + string proxyUser = "", + string proxyPassword = "" ) { setProxyServer( arguments.proxyHost ); + setProxyPort( arguments.proxyPort ); setProxyUser( arguments.proxyUser ); setProxyPassword( arguments.proxyPassword ); - setProxyPort( arguments.proxyPort ); return this; } diff --git a/tests/specs/unit/HyperRequestSpec.cfc b/tests/specs/unit/HyperRequestSpec.cfc index 0b1fd14..bd00a34 100644 --- a/tests/specs/unit/HyperRequestSpec.cfc +++ b/tests/specs/unit/HyperRequestSpec.cfc @@ -202,6 +202,25 @@ component extends="testbox.system.BaseSpec" { expect( req.getProxyPassword() ).toBe( "proxypass" ); } ); + it( "can set proxy settings without authentication", function() { + req.throughProxy( proxyHost = "proxy.example.com" ); + expect( req.getProxyServer() ).toBe( "proxy.example.com" ); + expect( req.getProxyPort() ).toBe( 80 ); + expect( req.getProxyUser() ).toBe( "" ); + expect( req.getProxyPassword() ).toBe( "" ); + } ); + + it( "can set proxy settings with custom port but no authentication", function() { + req.throughProxy( + proxyHost = "proxy.example.com", + proxyPort = 8080 + ); + expect( req.getProxyServer() ).toBe( "proxy.example.com" ); + expect( req.getProxyPort() ).toBe( 8080 ); + expect( req.getProxyUser() ).toBe( "" ); + expect( req.getProxyPassword() ).toBe( "" ); + } ); + it( "includes proxy settings in memento", function() { req.throughProxy( proxyHost = "proxy.example.com", From e47f2bc1e7a701bdcf293250b32833c26ed0674a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 18:47:21 +0000 Subject: [PATCH 09/10] Update JSDoc comment to reflect optional parameters Updated the documentation for proxyUser and proxyPassword to indicate they default to empty string, making it clear these parameters are optional. Co-authored-by: elpete <2583646+elpete@users.noreply.github.com> --- models/HyperRequest.cfc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index 0347593..847ce37 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -865,8 +865,8 @@ component accessors="true" { * * @proxyHost The proxy server host or IP address. * @proxyPort The proxy server port. Defaults to 80. - * @proxyUser The username for proxy authentication. - * @proxyPassword The password for proxy authentication. + * @proxyUser The username for proxy authentication. Defaults to empty string. + * @proxyPassword The password for proxy authentication. Defaults to empty string. * * @returns The HyperRequest instance. */ From 06736e408f6ab300583fbe84d1f535773a2d1beb Mon Sep 17 00:00:00 2001 From: Copilot Date: Sun, 25 Jan 2026 18:53:07 +0000 Subject: [PATCH 10/10] Apply cfformat changes --- models/HyperRequest.cfc | 4 ++-- tests/specs/unit/HyperRequestSpec.cfc | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index 847ce37..686e21e 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -872,8 +872,8 @@ component accessors="true" { */ function throughProxy( required string proxyHost, - numeric proxyPort = 80, - string proxyUser = "", + numeric proxyPort = 80, + string proxyUser = "", string proxyPassword = "" ) { setProxyServer( arguments.proxyHost ); diff --git a/tests/specs/unit/HyperRequestSpec.cfc b/tests/specs/unit/HyperRequestSpec.cfc index bd00a34..789d043 100644 --- a/tests/specs/unit/HyperRequestSpec.cfc +++ b/tests/specs/unit/HyperRequestSpec.cfc @@ -211,10 +211,7 @@ component extends="testbox.system.BaseSpec" { } ); it( "can set proxy settings with custom port but no authentication", function() { - req.throughProxy( - proxyHost = "proxy.example.com", - proxyPort = 8080 - ); + req.throughProxy( proxyHost = "proxy.example.com", proxyPort = 8080 ); expect( req.getProxyServer() ).toBe( "proxy.example.com" ); expect( req.getProxyPort() ).toBe( 8080 ); expect( req.getProxyUser() ).toBe( "" );