From e37db33d62112291f1f3a05d89c1c288e4c95759 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Fri, 5 Mar 2021 12:40:27 -0700 Subject: [PATCH] fixes custom parse --- agent/src/Lib/External/AppManifest.hs | 2 +- agent/test/Lib/External/AppManifestSpec.hs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/agent/src/Lib/External/AppManifest.hs b/agent/src/Lib/External/AppManifest.hs index 5e9bafbc2..158e3b2b4 100644 --- a/agent/src/Lib/External/AppManifest.hs +++ b/agent/src/Lib/External/AppManifest.hs @@ -137,7 +137,7 @@ instance FromJSON LanConfiguration where standard = withText "Standard Lan" \t -> if t == "standard" then pure Standard else fail "Not Standard Lan Conf" custom = withObject "Custom Lan" $ \o -> do - Custom <$> o .: "port" + Custom <$> (o .: "custom" >>= (.: "port")) data PortMapEntry = PortMapEntry { portMapEntryInternal :: Word16 , portMapEntryTor :: Word16 diff --git a/agent/test/Lib/External/AppManifestSpec.hs b/agent/test/Lib/External/AppManifestSpec.hs index c0448cffe..c8d4a9fc0 100644 --- a/agent/test/Lib/External/AppManifestSpec.hs +++ b/agent/test/Lib/External/AppManifestSpec.hs @@ -87,6 +87,11 @@ ports: - internal: 80 tor: 80 lan: standard + - internal: 443 + tor: 443 + lan: + custom: + port: 443 - internal: 3000 tor: 3000 lan: ~