Skip to content

Commit 1b2f387

Browse files
committed
Update artifacts
1 parent 9959f29 commit 1b2f387

File tree

5 files changed

+78
-62
lines changed

5 files changed

+78
-62
lines changed

net/http-server/coverage.ndjson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
[351,361,97.2299,47,50,94,5,5,100,351,361,97.2299,"b56de0cc59dcda436c89151c96463e4a8e797b7c","2025-08-15 02:15:58 -0700"]
2+
[362,366,98.9071,49,51,96.0784,5,5,100,362,366,98.9071,"2996658b99f63d5f4505f76d6393f6f75c1aec13","2025-08-15 03:13:49 -0700"]

net/http-server/index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ <h1><a href="../../../index.html">All files</a> net/http-server/lib</h1>
2323
<div class='clearfix'>
2424

2525
<div class='fl pad1y space-right2'>
26-
<span class="strong">97.22% </span>
26+
<span class="strong">98.9% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>351/361</span>
28+
<span class='fraction'>362/366</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
33-
<span class="strong">94% </span>
33+
<span class="strong">96.07% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>47/50</span>
35+
<span class='fraction'>49/51</span>
3636
</div>
3737

3838

@@ -44,9 +44,9 @@ <h1><a href="../../../index.html">All files</a> net/http-server/lib</h1>
4444

4545

4646
<div class='fl pad1y space-right2'>
47-
<span class="strong">97.22% </span>
47+
<span class="strong">98.9% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>351/361</span>
49+
<span class='fraction'>362/366</span>
5050
</div>
5151

5252

@@ -95,17 +95,17 @@ <h1><a href="../../../index.html">All files</a> net/http-server/lib</h1>
9595

9696
<tr>
9797
<td class="file high" data-value="main.js"><a href="main.js.html">main.js</a></td>
98-
<td data-value="95.47" class="pic high">
99-
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
98+
<td data-value="98.23" class="pic high">
99+
<div class="chart"><div class="cover-fill" style="width: 98%"></div><div class="cover-empty" style="width: 2%"></div></div>
100100
</td>
101-
<td data-value="95.47" class="pct high">95.47%</td>
102-
<td data-value="221" class="abs high">211/221</td>
103-
<td data-value="91.17" class="pct high">91.17%</td>
104-
<td data-value="34" class="abs high">31/34</td>
101+
<td data-value="98.23" class="pct high">98.23%</td>
102+
<td data-value="226" class="abs high">222/226</td>
103+
<td data-value="94.28" class="pct high">94.28%</td>
104+
<td data-value="35" class="abs high">33/35</td>
105105
<td data-value="100" class="pct high">100%</td>
106106
<td data-value="4" class="abs high">4/4</td>
107-
<td data-value="95.47" class="pct high">95.47%</td>
108-
<td data-value="221" class="abs high">211/221</td>
107+
<td data-value="98.23" class="pct high">98.23%</td>
108+
<td data-value="226" class="abs high">222/226</td>
109109
</tr>
110110

111111
<tr>
@@ -131,7 +131,7 @@ <h1><a href="../../../index.html">All files</a> net/http-server/lib</h1>
131131
<div class='footer quiet pad2 space-top1 center small'>
132132
Code coverage generated by
133133
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134-
at 2025-08-15T09:17:23.719Z
134+
at 2025-08-15T10:15:35.160Z
135135
</div>
136136
<script src="../../../prettify.js"></script>
137137
<script>

net/http-server/index.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
223223
<div class='footer quiet pad2 space-top1 center small'>
224224
Code coverage generated by
225225
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
226-
at 2025-08-15T09:17:23.719Z
226+
at 2025-08-15T10:15:35.160Z
227227
</div>
228228
<script src="../../../prettify.js"></script>
229229
<script>

net/http-server/main.js.html

Lines changed: 60 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
2323
<div class='clearfix'>
2424

2525
<div class='fl pad1y space-right2'>
26-
<span class="strong">95.47% </span>
26+
<span class="strong">98.23% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>211/221</span>
28+
<span class='fraction'>222/226</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
33-
<span class="strong">91.17% </span>
33+
<span class="strong">94.28% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>31/34</span>
35+
<span class='fraction'>33/35</span>
3636
</div>
3737

3838

@@ -44,9 +44,9 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
4444

4545

4646
<div class='fl pad1y space-right2'>
47-
<span class="strong">95.47% </span>
47+
<span class="strong">98.23% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>211/221</span>
49+
<span class='fraction'>222/226</span>
5050
</div>
5151

5252

@@ -284,7 +284,23 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
284284
<a name='L219'></a><a href='#L219'>219</a>
285285
<a name='L220'></a><a href='#L220'>220</a>
286286
<a name='L221'></a><a href='#L221'>221</a>
287-
<a name='L222'></a><a href='#L222'>222</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
287+
<a name='L222'></a><a href='#L222'>222</a>
288+
<a name='L223'></a><a href='#L223'>223</a>
289+
<a name='L224'></a><a href='#L224'>224</a>
290+
<a name='L225'></a><a href='#L225'>225</a>
291+
<a name='L226'></a><a href='#L226'>226</a>
292+
<a name='L227'></a><a href='#L227'>227</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
293+
<span class="cline-any cline-yes">1x</span>
294+
<span class="cline-any cline-yes">1x</span>
295+
<span class="cline-any cline-yes">1x</span>
296+
<span class="cline-any cline-yes">1x</span>
297+
<span class="cline-any cline-yes">1x</span>
298+
<span class="cline-any cline-yes">1x</span>
299+
<span class="cline-any cline-yes">1x</span>
300+
<span class="cline-any cline-yes">1x</span>
301+
<span class="cline-any cline-yes">1x</span>
302+
<span class="cline-any cline-yes">1x</span>
303+
<span class="cline-any cline-yes">1x</span>
288304
<span class="cline-any cline-yes">1x</span>
289305
<span class="cline-any cline-yes">1x</span>
290306
<span class="cline-any cline-yes">1x</span>
@@ -371,12 +387,16 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
371387
<span class="cline-any cline-yes">20x</span>
372388
<span class="cline-any cline-yes">20x</span>
373389
<span class="cline-any cline-yes">20x</span>
390+
<span class="cline-any cline-yes">20x</span>
391+
<span class="cline-any cline-yes">20x</span>
392+
<span class="cline-any cline-yes">20x</span>
374393
<span class="cline-any cline-yes">9x</span>
375394
<span class="cline-any cline-yes">1x</span>
376395
<span class="cline-any cline-yes">9x</span>
377396
<span class="cline-any cline-yes">8x</span>
378397
<span class="cline-any cline-yes">8x</span>
379398
<span class="cline-any cline-yes">8x</span>
399+
<span class="cline-any cline-yes">8x</span>
380400
<span class="cline-any cline-yes">20x</span>
381401
<span class="cline-any cline-yes">10x</span>
382402
<span class="cline-any cline-yes">10x</span>
@@ -385,10 +405,15 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
385405
<span class="cline-any cline-yes">8x</span>
386406
<span class="cline-any cline-yes">2x</span>
387407
<span class="cline-any cline-yes">2x</span>
408+
<span class="cline-any cline-yes">2x</span>
388409
<span class="cline-any cline-yes">20x</span>
389410
<span class="cline-any cline-yes">2x</span>
390411
<span class="cline-any cline-yes">2x</span>
391412
<span class="cline-any cline-yes">20x</span>
413+
<span class="cline-any cline-yes">8x</span>
414+
<span class="cline-any cline-yes">8x</span>
415+
<span class="cline-any cline-yes">8x</span>
416+
<span class="cline-any cline-yes">20x</span>
392417
<span class="cline-any cline-yes">5x</span>
393418
<span class="cline-any cline-yes">5x</span>
394419
<span class="cline-any cline-yes">5x</span>
@@ -431,24 +456,9 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
431456
<span class="cline-any cline-yes">10x</span>
432457
<span class="cline-any cline-yes">10x</span>
433458
<span class="cline-any cline-yes">10x</span>
434-
<span class="cline-any cline-yes">10x</span>
435459
<span class="cline-any cline-yes">16x</span>
436460
<span class="cline-any cline-yes">16x</span>
437461
<span class="cline-any cline-yes">16x</span>
438-
<span class="cline-any cline-yes">16x</span>
439-
<span class="cline-any cline-yes">16x</span>
440-
<span class="cline-any cline-yes">16x</span>
441-
<span class="cline-any cline-yes">16x</span>
442-
<span class="cline-any cline-yes">16x</span>
443-
<span class="cline-any cline-yes">16x</span>
444-
<span class="cline-any cline-yes">16x</span>
445-
<span class="cline-any cline-no">&nbsp;</span>
446-
<span class="cline-any cline-no">&nbsp;</span>
447-
<span class="cline-any cline-no">&nbsp;</span>
448-
<span class="cline-any cline-no">&nbsp;</span>
449-
<span class="cline-any cline-no">&nbsp;</span>
450-
<span class="cline-any cline-no">&nbsp;</span>
451-
<span class="cline-any cline-yes">16x</span>
452462
<span class="cline-any cline-yes">8x</span>
453463
<span class="cline-any cline-yes">8x</span>
454464
<span class="cline-any cline-yes">16x</span>
@@ -530,8 +540,8 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
530540
var http = require( 'http' );
531541
var logger = require( 'debug' );
532542
var isFunction = require( '@stdlib/assert/is-function' );
533-
var isObject = require( '@stdlib/assert/is-object' );
534543
var NODE_VERSION = require( '@stdlib/process/node-version' );
544+
var omit = require( '@stdlib/utils/omit' );
535545
var format = require( '@stdlib/string/format' );
536546
var validate = require( './validate.js' );
537547
var DEFAULTS = require( './defaults.json' );
@@ -542,12 +552,23 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
542552
var debug = logger( '@stdlib/net/http-server' );
543553
var SUPPORTS_OPTIONS = ( parseInt( NODE_VERSION.split( '.' )[ 0 ], 10 ) &gt;= 8 ); // TODO: this is an imperfect test, as options only added in v8.12.0/v9.6.0
544554
&nbsp;
555+
var EXCLUDE_OPTIONS = [
556+
'port',
557+
'maxport',
558+
'hostname',
559+
'address'
560+
];
561+
&nbsp;
545562
&nbsp;
546563
// MAIN //
547564
&nbsp;
548565
/**
549566
* Returns a function which creates an HTTP server.
550567
*
568+
* ## Notes
569+
*
570+
* - In addition to options documented below, the function supports any options supported by `http.createServer`. Which server options are supported depends on the Node.js version. Older Node.js versions (e.g., &lt;= v8.12.0) do not support an options object when calling `http.createServer`, and, for those versions, any options specific to Node.js are ignored.
571+
*
551572
* @param {Options} [options] - server options
552573
* @param {NonNegativeInteger} [options.port=0] - server port
553574
* @param {NonNegativeInteger} [options.maxport] - max server port
@@ -584,19 +605,23 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
584605
var hostname;
585606
var options;
586607
var nargs;
608+
var sopts;
587609
var opts;
588610
var port;
589611
var max;
590612
var err;
613+
var flg;
591614
&nbsp;
592615
nargs = arguments.length;
616+
sopts = {};
593617
opts = {};
594618
if ( nargs === 1 ) {
595619
if ( isFunction( arguments[0] ) ) {
596620
requestListener = arguments[ 0 ];
597621
} else {
598622
options = arguments[ 0 ];
599623
err = validate( opts, options );
624+
flg = true;
600625
}
601626
} else if ( nargs &gt; 1 ) {
602627
options = arguments[ 0 ];
@@ -605,10 +630,15 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
605630
throw new TypeError( format( 'invalid argument. Request listener must be a function. Value: `%s`.', requestListener ) );
606631
}
607632
err = validate( opts, options );
633+
flg = true;
608634
}
609635
if ( err ) {
610636
throw err;
611637
}
638+
if ( flg ) {
639+
// Resolve any server-specific options which should be passed to `http.createServer`:
640+
sopts = omit( options, EXCLUDE_OPTIONS );
641+
}
612642
if ( opts.port === void 0 ) {
613643
port = DEFAULTS.port;
614644
} else {
@@ -638,7 +668,6 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
638668
* Creates an HTTP server.
639669
*
640670
* @private
641-
* @param {Options} [options] - server options
642671
* @param {Callback} done - function to invoke after creating a server
643672
* @throws {TypeError} must provide a function
644673
*
@@ -652,34 +681,20 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
652681
* }
653682
* httpServer( done );
654683
*/
655-
function httpServer( options, done ) {
684+
function httpServer( done ) {
656685
var server;
657-
var nargs;
658-
var opts;
659-
var cb;
660686
&nbsp;
661-
nargs = arguments.length;
662-
if ( nargs &lt; 2 ) {
663-
opts = {};
664-
cb = options;
665-
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
666-
<span class="cstat-no" title="statement not covered" > opts = options;</span>
667-
<span class="cstat-no" title="statement not covered" > if ( !isObject( opts ) ) {</span>
668-
<span class="cstat-no" title="statement not covered" > throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );</span>
669-
<span class="cstat-no" title="statement not covered" > }</span>
670-
<span class="cstat-no" title="statement not covered" > cb = done;</span>
671-
<span class="cstat-no" title="statement not covered" > }</span>
672-
if ( !isFunction( cb ) ) {
673-
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', cb ) );
687+
if ( !isFunction( done ) ) {
688+
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', done ) );
674689
}
675690
if ( requestListener ) {
676691
if ( SUPPORTS_OPTIONS ) {
677-
server = http.createServer( opts, requestListener );
692+
server = http.createServer( sopts, requestListener );
678693
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
679694
<span class="cstat-no" title="statement not covered" > server = http.createServer( requestListener );</span>
680695
<span class="cstat-no" title="statement not covered" > }</span>
681696
} else if ( SUPPORTS_OPTIONS ) {
682-
server = http.createServer( opts );
697+
server = http.createServer( sopts );
683698
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
684699
<span class="cstat-no" title="statement not covered" > server = http.createServer();</span>
685700
<span class="cstat-no" title="statement not covered" > }</span>
@@ -717,7 +732,7 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
717732
function onListen() {
718733
var addr = server.address();
719734
debug( 'HTTP server initialized. Server is listening for requests on %s:%d.', addr.address, addr.port );
720-
cb( null, server );
735+
done( null, server );
721736
}
722737
}
723738
}
@@ -733,7 +748,7 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
733748
<div class='footer quiet pad2 space-top1 center small'>
734749
Code coverage generated by
735750
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
736-
at 2025-08-15T09:17:23.719Z
751+
at 2025-08-15T10:15:35.160Z
737752
</div>
738753
<script src="../../../prettify.js"></script>
739754
<script>

net/http-server/validate.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ <h1><a href="../../../index.html">All files</a> / <a href="index.html">net/http-
337337
<div class='footer quiet pad2 space-top1 center small'>
338338
Code coverage generated by
339339
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
340-
at 2025-08-15T09:17:23.719Z
340+
at 2025-08-15T10:15:35.160Z
341341
</div>
342342
<script src="../../../prettify.js"></script>
343343
<script>

0 commit comments

Comments
 (0)