123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <?xml version="1.0" encoding="utf-8"?>
- <!--
-
- h t t :: / / t /
- h t t :: // // t //
- h ttttt ttttt ppppp sssss // // y y sssss ttttt //
- hhhh t t p p s // // y y s t //
- h hh t t ppppp sssss // // yyyyy sssss t //
- h h t t p s :: / / y .. s t .. /
- h h t t p sssss :: / / yyyyy .. sssss t .. /
-
- <https://y.st./>
- Copyright © 2016 Alex Yst <mailto:copyright@y.st>
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org./licenses/>.
- -->
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <base href="https://y.st./en/weblog/2016/01-January/26.xhtml" />
- <title>Learning about the ircs: URI scheme <https://y.st./en/weblog/2016/01-January/26.xhtml></title>
- <link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
- <link rel="stylesheet" type="text/css" href="/link/basic.css" />
- <link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
- <script type="text/javascript" src="/script/javascript.js" />
- <meta name="viewport" content="width=device-width" />
- </head>
- <body>
- <nav>
- <p>
- <a href="/en/">Home</a> |
- <a href="/en/a/about.xhtml">About</a> |
- <a href="/en/a/contact.xhtml">Contact</a> |
- <a href="/a/canary.txt">Canary</a> |
- <a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
- <a href="/en/opinion/">Opinions</a> |
- <a href="/en/coursework/">Coursework</a> |
- <a href="/en/law/">Law</a> |
- <a href="/en/a/links.xhtml">Links</a> |
- <a href="/en/weblog/2016/01-January/26.xhtml.asc">{this page}.asc</a>
- </p>
- <hr/>
- <p>
- Weblog index:
- <a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
- <a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
- <a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
- </p>
- <hr/>
- <p>
- Jump to entry:
- <a href="/en/weblog/2015/03-March/07.xhtml"><<First</a>
- <a rel="prev" href="/en/weblog/2016/01-January/25.xhtml"><Previous</a>
- <a rel="next" href="/en/weblog/2016/01-January/27.xhtml">Next></a>
- <a href="/en/weblog/latest.xhtml">Latest>></a>
- </p>
- <hr/>
- </nav>
- <header>
- <h1>Learning about the <code>ircs:</code> <abbr title="Uniform Resource Identifier">URI</abbr> scheme</h1>
- <p>Day 00325: Tuesday, 2016 January 26</p>
- </header>
- <p>
- I have been dealing with an ear infection over the past few days, and it has been worrying me quite a bit.
- I have been told that ear infections require treatment.
- I did some research online, and the results backed up my fear.
- They all said that antibiotics are required, but the health insurance people still have not gotten back to me.
- I decided to rephrase my search.
- Instead of asking what needs to be done about ear infections, I asked about what happens if ear infections are not treated.
- Mostly, the results were much more reassuring.
- As it turns out, medical professionals often say to wait out ear infections instead of prescribing antibiotics in an effort to avoid having the bacteria build up a resistance to the antibiotics.
- If I went to see a doctor, there is a good chance that I would not be prescribed anything anyway.
- Furthermore, ear infections appear to be common right after having caught a cold, and I have just gotten over one.
- The bacteria in my ear is likely just common cold bacteria and is likely nothing more than annoying.
- I also learned about the anatomy of the ear and why I do not seem to be able to drain the liquid I feel in there; it is behind the ear drum.
- There is a drainage tube leading from the liquid chamber behind the ear drum to the throat, but when this tube becomes swollen, liquid cannot drain and it becomes a cesspool.
- In some cases, this buildup can lead to a rupture of the ear drum.
- This sounds painful, but according to what the Internet said, it actually brings relief to the pain, as the liquid can drain, then the ear drum heals later.
- This makes a lot more sense, as it seems like it would have been quite difficult for the human species to survive before medication existed if something as small as an ear infection was likely to be highly hazardous.
- Evolution would have favored those that could survive with minimal damage.
- On the other hand, there was some worrying news too.
- One site said that there is an eighty percent chance that an ear infection will clear up without complications.
- Of course, I read that as there being a twenty percent chance of complications.
- I find that percentage to be alarmingly high! Another site mentioned that sometimes, an ear infection can lead to a brain infection, which would not be good news at all.
- </p>
- <p>
- Though I am feeling under the weather, it seems that our cat is feeling a lot better.
- She has been much more active and much less mopey lately.
- </p>
- <p>
- I headed out to get help with the government health insurance application in-person, fearing that my mailed-in application had been silently ignored.
- I made it most of the way to the building of the company that the government health care website said could help with little difficulty, but the street addresses on that street are screwy.
- I got to one spot in which the addresses went down in both directions.
- Confused, I had to stop and ask for directions.
- Once I got there, I found that the official government health care website had lied.
- I had walked out past the edge of the far end of town for nothing.
- These people were not able to help.
- The trip was not a complete bust though, I suppose.
- The man there did have some useful information.
- First, he explained that when he applied for coverage, it took two months for them to respond, and that was during their off season.
- I only applied a little over a month ago, an now is their busy season.
- Second, there is a clinic a lot closer to my home that can help with the application.
- I still want to try submitting in person, just to be safe.
- </p>
- <p>
- By altering my route a bit, I was able to pass by very close to the clinic on the way home, so I made a slight detour and stopped by the clinic.
- They were unable to help with the application right away, but they had me register with the clinic and set up an appointment for Monday.
- Monday is the day after the application is due though, so I do not know how helpful that will be.
- Hopefully either the mailed-in application or the day-late application will be accepted though.
- </p>
- <p>
- I found a flaw in the regular expression mentioned in <a href="https://tools.ietf.org/html/rfc3986"><abbr title="Request for Comments">RFC</abbr> 3986</a>.
- This regular expression works perfectly if the <abbr title="Uniform Resource Identifier">URI</abbr> that is being parsed is known to be valid, but I malformed <abbr title="Uniform Resource Identifier">URI</abbr>s with blank schemes will cause the scheme's delimiter, the colon, to be interpreted as the authority and causes the double slash delimitor and the authority to be interpreted as part of the path.
- I built my own regular expression to fix this issue, and my new regular expression additionally parses the userdata, host, and port out of the authority component.
- My new <code>parse_uri()</code> function will now return a similar array as <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>'s <a href="https://secure.php.net/manual/en/function.parse-url.php"><code>\parse_url()</code> function</a>, but with a few key differences.
- First and formost, <code>\parse_url()</code>'s documentation says that it does not work on general <abbr title="Uniform Resource Identifier">URI</abbr>s and does not work on relative <abbr title="Uniform Resource Identifier">URI</abbr>s.
- However, <code>parse_uri()</code> is designed explicitly to work with all <abbr title="Uniform Resource Identifier">URI</abbr>s that conform to the general syntax, including relative <abbr title="Uniform Resource Identifier">URI</abbr>s.
- Second, <code>parse_uri()</code> will by default call another function, <code>normalize_uri()</code>.
- This function will perform any normalizations needed, and also throw an exception if a <abbr title="Uniform Resource Identifier">URI</abbr>'s components are invalid.
- To deal with invalid <abbr title="Uniform Resource Identifier">URI</abbr>s, <code>parse_uri()</code> can be told with an argument to avoid normalization.
- Last, and least importantly, <code>parse_uri()</code> does not have "user" and "pass" keys in its returned array.
- Instead, it has a unified "userinfo" key, as the general <abbr title="Uniform Resource Identifier">URI</abbr> syntax does not split up the userinfo into user and password information.
- This separation is left for specific <abbr title="Uniform Resource Identifier">URI</abbr> schemes to implement in whatever way they decide to.
- </p>
- <p>
- Having learned more about <abbr title="Uniform Resource Identifier">URI</abbr>s, I now know that the default port used by a <abbr title="Uniform Resource Identifier">URI</abbr> with no explicitly-set port is not set by the <a href="https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml">port registry</a>.
- Instead, the default port for a <abbr title="Uniform Resource Identifier">URI</abbr> is defined by the scheme's definition.
- If I am going to set up the function to normalize <abbr title="Uniform Resource Identifier">URI</abbr>s, I am going to need to know the port numbers associated with each scheme, so I looked up the <a href="https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml">scheme registry</a>.
- I was curious about the defined default for the <code>ircs:</code> and <code>irc:</code> schemes, as many ports are used for both protocols.
- It turns out that <a href="https://tools.ietf.org/html/draft-butcher-irc-url-04#section-2.4">the <code>ircs:</code> scheme uses the official <abbr title="Internet Relay Chat over SSL">IRCS</abbr> port assigned by <abbr title="Internet Assigned Numbers Authority">IANA</abbr> as its default, but the <code>irc:</code> scheme uses one of the newer alternative ports allowed by <abbr title="Internet Assigned Numbers Authority">IANA</abbr></a>.
- This seems inconsistent to me.
- More importantly though, it means that I need to fix all the links to <abbr title="Internet Relay Chat">IRC</abbr> networks in my weblog.
- I assumed port 6697 as the default, but port 994 is the real default, so I need to correct my hyperlinks to explicitly specify a port.
- </p>
- <p>
- It also seems that the fragment of a <abbr title="Uniform Resource Identifier">URI</abbr> is delimited by the pound symbol, but cannot contain pound symbols.
- This lead to more questions for me in regards to the <code>ircs:</code> scheme.
- First, that means when using the <abbr title="Uniform Resource Identifier">URI</abbr> <code>ircs://example.com/#channel</code>, it should be interpreted as having a fragment of <code>channel</code>, which as it does not contain the pound symbol, is not a complete channel name.
- Second, the <abbr title="Uniform Resource Identifier">URI</abbr> <code>ircs://example.com/#channel,#otherchannel</code> should be invalid, as it has two pound symbols.
- This also means that links to channels not beginning in a pound symbol, while rare, will be interpreted as path data, while channels beginning in a pound symbol will be interpreted as the presence of a fragment, as well as the data contained in the fragment.
- I found several interesting things though.
- First, the syntax used to link to multiple channels using a single <abbr title="Uniform Resource Identifier">URI</abbr> is invalid.
- The <a href="https://tools.ietf.org/html/draft-butcher-irc-url-04#section-2.1">official syntax</a> simply does not work that way.
- Second, the <code>ircs:</code> and <code>irc:</code> schemes treat <a href="https://tools.ietf.org/html/draft-butcher-irc-url-04#section-2.5.1">unencoded pound signs</a> as <a href="https://tools.ietf.org/html/draft-butcher-irc-url-04#section-3">equivalent to encoded pound signs</a>.
- This means that a general-purpose <abbr title="Uniform Resource Identifier">URI</abbr> parser will interpret channel names as part of the path or as the beginning of the fragment depending on if the pound sign is encoded or not, but an <code>ircs:</code>/<code>irc:</code> scheme-specific parser will not.
- I do not anticipate that this will cause issues for my parser though, as long as <abbr title="Uniform Resource Identifier">URI</abbr>s still conform to the <code>ircs:</code>/<code>irc:</code> scheme specification, as only one channel name is allowed per <abbr title="Uniform Resource Identifier">URI</abbr>, so only one pound sign, if any, should be present.
- Invalid <abbr title="Uniform Resource Identifier">URI</abbr>s that try to point to multiple channels might cause issues though.
- Another interesting feature is that it is possible to <a href="https://tools.ietf.org/html/draft-butcher-irc-url-04#section-2.5.2">link to users</a> instead of channels.
- One thing that I do not like about this scheme though is that instead of an <abbr title="Internet Protocol">IP</abbr> address or domain name, you can also link to an <a href="https://tools.ietf.org/html/draft-butcher-irc-url-04#section-2.3">unregistered pet name</a>.
- As long as everyone is using the same pet name list, that works, but using domain names is a much more reliable option.
- </p>
- <p>
- My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
- </p>
- <hr/>
- <p>
- Copyright © 2016 Alex Yst;
- You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU's Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
- If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
- My address is in the source comments near the top of this document.
- This license also applies to embedded content such as images.
- For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
- </p>
- <p>
- <abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
- This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2016%2F01-January%2F26.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.1</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2016%2F01-January%2F26.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
- </p>
- </body>
- </html>
|