Groups
Groups
Sign in
Groups
Groups
RestSharp
Conversations
About
Send feedback
Help
Why does RestSharp allow 'localhost' as a valid host, but not 'http://localhost'?
15 views
Skip to first unread message
Brendan Pert
unread,
Jan 21, 2025, 11:17:20 PM
Jan 21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RestSharp
Why does RestSharp allow 'localhost' as a valid host, but not '
http://localhost
' or '
https://localhost
'?
As seen in this pull request from a while ago showing the Host Validation Test Cases:
https://github.com/restsharp/RestSharp/pull/505/files/83f79a5aeb368451b1db3c4622be6c83959ca67b#diff-c48e8d090328a7563564b12a4ec12ba1835ab06d034b1881a906b641fd185d0c
The Test Cases are setup so
[
InlineData
(
"
http://localhost
"
)
]
fails validation while
[
InlineData
(
"localhost"
)
]
passes validation.
What is the reasoning behind this?
I've looked elsewhere online but haven't been able to find an answer.
Many Thanks,
Brendan
Reply all
Reply to author
Forward
0 new messages