chore(internet_port): added new ports and removed unnecessary string class (#27078)

This commit is contained in:
Anirudh Hegde 2024-02-15 08:00:14 +05:30 committed by GitHub
parent 9514300da5
commit 3224ac1818
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 3 deletions

View File

@ -48,6 +48,11 @@ port_conversion_dict: dict[str, list[int]] = {
"ldaps": [636],
"imap2": [143], # aka imap
"imaps": [993],
"MySQL": [3306],
"Remote Desktop": [3389],
"dns": [53],
"ctf": [84],
"pdap": [344],
}
@ -83,9 +88,9 @@ def port_translation_func(req: AdvancedDataTypeRequest) -> AdvancedDataTypeRespo
else port_conversion_dict[string_value]
)
except (KeyError, ValueError):
resp["error_message"] = str(
f"'{string_value}' does not appear to be a port name or number"
)
resp[
"error_message"
] = f"'{string_value}' does not appear to be a port name or number"
break
else:
resp["display_value"] = ", ".join(