<!DOCTYPE html>
<html>
<head>
</head>
<body>
<dl style="line-height: 1.5; margin-left: 2em">
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
<dd style="margin-left: 8.5em">SHIMODA Hiroshi <shimo****@clear*****></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
<dd style="margin-left: 8.5em">2012-08-02 18:39:22 +0900 (Thu, 02 Aug 2012)</dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
<dd style="margin-left: 8.5em"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b">171618bbbee47eb97a88d2b671a327cd9ec8cc6b</a></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Log</dt>
<dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; padding: 0.5em">Accept multiple priviledged IP ranges correctly</pre></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
<dd style="margin-left: 8.5em">
<ul>
<li><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#diff-0">lib/api/2011-02-01/configuration.js</a></li>
</ul>
</dd>
</dl>
<div class="diff-section" style="clear: both">
<table style="border-collapse: collapse; border: 1px solid #aaa">
<thead>
<tr class="diff-header" style="border: 1px solid #aaa">
<td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre"> Modified: lib/api/2011-02-01/configuration.js (+4 -3)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
</td>
</tr>
</thead>
<tbody>
<tr>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L329">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L330">330</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L331">331</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L332">332</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L333">333</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L334">334</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L335">335</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L336">336</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L337">337</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L338">338</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L339">339</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L340">340</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L341">341</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L342">342</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0L343">343</a></span>
</pre>
</th>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R329">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R330">330</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R331">331</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R332">332</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R333">333</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R334">334</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R335">335</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R336">336</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R337">337</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R338">338</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R339">339</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R340">340</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R341">341</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R342">342</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R343">343</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/gcs/commit/171618bbbee47eb97a88d2b671a327cd9ec8cc6b#L0R344">344</a></span>
</pre>
</th>
<td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -330,14 +330,15 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">function getClientIp(request) {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> exports.createHandler = function(context, config) {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- var privilegedRanges = config && config.privilegedRanges;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- privilegedRanges = privilegedRanges.split(/[,\| ]/);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ var privilegedRanges = config &&</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ config.privilegedRanges &&</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ config.privilegedRanges.split(/[,\| ]/);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> return function(request, response, next) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> var message, body;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> // GCS specific behaviour: prevent to access this API from specific IP</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> // range.</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- if (privilegedRange) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ if (privilegedRanges && privilegedRanges.length) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> if (!privilegedRanges.some(function(privilegedRange) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> return ipv4.isInRange(getClientIp(request), privilegedRange);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> })) {</span>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>