<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/4377/">https://reviewboard.asterisk.org/r/4377/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 27th, 2015, 1:46 a.m. CST, <b>wdoekes</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">> 1) Server: Asterisk/<version
> 2) Server: JohnMcClane
> 3) Server:

Any particular reason why we don't simply omit the header in the third case?

The ABNF at 14.38 here [1] says:
Server         = "Server" ":" 1*( product | comment )
that is, one or more, not zero or more

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I went back and forth with this during development. On one hand, the RFC you called out specifies that all header fields have some value. But, on the other hand, the question kept bugging me, "would implementing a configuration property in this way, where blank had a different meaning than all other values, violate the principle of least astonishment?" Even though I realized that the former was technically the correct way to implement this, ultimately, I went with the latter as my reasoning, so as not to create unexpected behavior. 

***However, it can be argued that failing to honor the RFC would equally create astonishment. And, since this is technically the correct way to implement this feature, the behavior has been modified as follows:

This test verifies that the HTTP server correctly reports the expected name through the [Server] header field in all HTTP responses. It uses three instances of Asterisk to test the three possible logic paths:
1) No configuration was provided
2) A non-empty/non-null value was provided through the new configuration property [servername]
3) An empty/null value was provided through the new configuration property [servername]

For clarity, consider this example for the possible outcomes as described above, respectively:
1) There was nothing configured for [servername].
2) The user configured a non-empty value for [servername] (e.g. servername="JohnMcClane")
3) The user configured an empty/null value for [servername] (e.g. servername="")

The HTTP server is expected to create the [Server] header field as follows, respectively:
1) Server: Asterisk/<version>
2) Server: JohnMcClane
3) 

In case #3, the [Server] header field will be omitted from HTTP response headers.</pre>
<br />










<p>- Ashley</p>


<br />
<p>On January 26th, 2015, 9:27 p.m. CST, Ashley Sanders wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Ashley Sanders.</div>


<p style="color: grey;"><i>Updated Jan. 26, 2015, 9:27 p.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-24316">ASTERISK-24316</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
testsuite
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Currently, all responses from the Asterisk HTTP server contain a [Server] header that identifies Asterisk and its version (e.g. "Server:Asterisk/<version>", where <version> is the currently running version of Asterisk). The preferred behavior is to allow the user to configure an alternate name to use for the value returned in the [Server] header for HTTP responses (e.g. "Server:SomeSuperAwesomeServerName").

This patch to the Asterisk source provides a new configuration property, [servername], in http.conf, that gives users the ability to modify the value that Asterisk uses when identifying itself. 

This test verifies that the HTTP server correctly reports the expected name through the [Server] header in all HTTP responses. It uses three instances of Asterisk to test the three possible logic paths:
1) No configuration was provided
2) A non-empty/non-null value was provided through the new configuration property [servername]
3) An empty/null value was provided through the new configuration property [servername]

For clarity, consider this example for the possible outcomes as described above, respectively:
1) There was nothing configured for [servername].
2) The user configured a non-empty value for [servername] (e.g. servername="JohnMcClane")
3) The user configured an empty/null value for [servername] (e.g. servername="")

The HTTP server is expected to create the [Server] header as follows, respectively:
1) Server: Asterisk/<version
2) Server: JohnMcClane
3) Server:

***Note*** This is the test. It is only the test. You can find the review for the Asterisk source at: https://reviewboard.asterisk.org/r/4374/</pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>./asterisk/trunk/tests/tests.yaml <span style="color: grey">(6339)</span></li>

 <li>./asterisk/trunk/tests/http_server/tests.yaml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>./asterisk/trunk/tests/http_server/servername/test-config.yaml <span style="color: grey">(PRE-CREATION)</span></li>

 <li>./asterisk/trunk/tests/http_server/servername/run-test <span style="color: grey">(PRE-CREATION)</span></li>

 <li>./asterisk/trunk/tests/http_server/servername/configs/ast3/http.conf <span style="color: grey">(PRE-CREATION)</span></li>

 <li>./asterisk/trunk/tests/http_server/servername/configs/ast2/http.conf <span style="color: grey">(PRE-CREATION)</span></li>

 <li>./asterisk/trunk/tests/http_server/servername/configs/ast1/http.conf <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/4377/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>