Are schemeless urls like
//blog.flowl.info/
valid in HTTP (rfc?), like in plain HTTP Requests and Responses, or are they only valid in HTML attributes and content ?
HTTP/1.1 302 - Moved
Location: //blog.flowl.info
GET //blog.flowl.info
Update:
I have two contradictionary answers now. Which is correct?
Sidequestion: Why does the browser even resolve those to:
//blog.flowl.info/
->
http://blog.flowl.info/
instead of:
//blog.flowl.info/
->
http://blog.flowl.info///blog.flowl.info/
Given a URL as a character string str of size N .The task is to check if the given URL is valid or not. The above URL is a valid URL. Note that there is a space after https://, hence the URL is invalid. An approach using java.net.url class to validate a URL is discussed in the previous post.
When a URL’s protocol is omitted, the browser uses the underlying document’s protocol instead. This would allow both (http and https) versions of my Swagger docs to have a working "Try It out!" feature. Sorry, something went wrong.
The above URL is a valid URL. Note that there is a space after https://, hence the URL is invalid. An approach using java.net.url class to validate a URL is discussed in the previous post.
1 The URL must start with either http or https and 2 then followed by :// and 3 then it must contain www. and 4 then followed by subdomain of length (2, 256) and 5 last part contains top level domain like .com, .org etc.
They are valid in the Location header field (http://greenbytes.de/tech/webdav/rfc7231.html#header.location).
They are not valid in the request line of an HTTP request.
The browser resolves it this way because this is how relative reference resolution works (http://greenbytes.de/tech/webdav/rfc3986.html#reference-resolution).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With