Trimming of whitespace characters in API endpoint URL

Developer saved an API endpoint with URL with a tab/space in the end via cut and paste into the field. When the user tried to use the Invoke-RestMethod, this endpoint failed with a 404 error.

Can whitespace character for URL field in API be trimmed on save to prevent this error?

Copying URL
Invoke-RestMethod https://powershell-universal/rest/withtab

Looking at endpoints.ps1
New-PSUEndpoint -Url "/rest/withtab " -Endpoint {
“hello world.”
}

I raised an issue here for this: Trim Whitespace from API Endpoint URLs · Issue #1454 · ironmansoftware/issues · GitHub

We should be trimming that whitespace automatically.

You’re able to paste into the URL field with whitespace in the end and save. If you type, this doesn’t happen.