This is an automated email from the ASF dual-hosted git repository. ocket8888 pushed a commit to branch 3.x in repository https://gitbox.apache.org/repos/asf/trafficcontrol-trafficops-types.git
commit 55e77674f8aafc366ade4d0d7c4b7ca3ce4ebc13 Author: ocket8888 <[email protected]> AuthorDate: Fri Jan 27 19:01:44 2023 -0700 add support for null protocols to protocolToString (cherry picked from commit d46dd9c6428c04ff9ce09380a732e9f6fa1dc53a) --- src/delivery.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/delivery.service.ts b/src/delivery.service.ts index 9dc457b..2ec5048 100644 --- a/src/delivery.service.ts +++ b/src/delivery.service.ts @@ -82,9 +82,9 @@ export const enum Protocol { * Converts Protocols to a textual representation. * * @param p The Protocol to convert. - * @returns A string representation of 'p', or 'UNKNOWN' if 'p' was unrecognized. + * @returns A string representation of 'p', or a blank string if 'p' was null. */ -export function protocolToString(p: Protocol): string { +export function protocolToString(p: Protocol | null): string { switch (p) { case Protocol.HTTP: return "Serve only unsecured HTTP requests"; @@ -95,6 +95,7 @@ export function protocolToString(p: Protocol): string { case Protocol.HTTP_TO_HTTPS: return "Serve secured HTTPS requests normally, but redirect unsecured HTTP requests to use HTTPS"; } + return ""; } /**
