<div dir="ltr">Why does the <b>getResource()</b> method in <b>ServletContextImpl</b> have the following check<div><br></div><div><font face="monospace">        if (!path.startsWith(&quot;/&quot;)) {<br>            throw UndertowServletMessages.MESSAGES.pathMustStartWithSlash(path);<br>        }<br></font></div><div><br></div><div>but the <b>getResourceAsStream()</b> method in the same class does not.  </div><div><br></div><div>The ServletContext spec does say &quot;<i>The path must begin with a / </i>&quot; for the <b>getResource()</b> method</div><div><a href="https://javaee.github.io/javaee-spec/javadocs/javax/servlet/ServletContext.html#getResource-java.lang.String-">https://javaee.github.io/javaee-spec/javadocs/javax/servlet/ServletContext.html#getResource-java.lang.String-</a> </div><div> <br></div><div>And the <b>getResourceAsStream()</b> method also says that &quot;<i>The path must be specified according to the rules given in <b>getResource</b></i>&quot;</div><div><br></div><div><a href="https://javaee.github.io/javaee-spec/javadocs/javax/servlet/ServletContext.html#getResourceAsStream-java.lang.String-">https://javaee.github.io/javaee-spec/javadocs/javax/servlet/ServletContext.html#getResourceAsStream-java.lang.String-</a>  <br></div><div><br></div><div>So it seems the same validation rules should apply to both methods.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div></div><div>Thanks!</div><div><br></div><div>~Brad</div><div><br></div><div><b>Developer Advocate</b></div><div><i>Ortus Solutions, Corp </i></div><div><b><br></b></div><div>E-mail: <a href="mailto:brad@coldbox.org" target="_blank">brad@coldbox.org</a></div><div>ColdBox Platform: <a href="http://www.coldbox.org" target="_blank">http://www.coldbox.org</a> </div><div>Blog: <a href="http://www.codersrevolution.com" target="_blank">http://www.codersrevolution.com</a></div><div><br></div></div></div></div></div></div></div></div>