Skip to content

Commit c94482b

Browse files
mbarinovMyles Borins
authored and
Myles Borins
committed
http: 451 status code "Unavailable For Legal Reasons"
This http code allows us to provide a fair reason when we can't return some data to the client by legal issues. IETF https://datatracker.ietf.org/doc/draft-ietf-httpbis-legally-restricted-status/ Fixes: #4376 PR-URL: #4377 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4a6bd86 commit c94482b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/_http_server.js

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const STATUS_CODES = exports.STATUS_CODES = {
6565
428: 'Precondition Required', // RFC 6585
6666
429: 'Too Many Requests', // RFC 6585
6767
431: 'Request Header Fields Too Large', // RFC 6585
68+
451: 'Unavailable For Legal Reasons',
6869
500: 'Internal Server Error',
6970
501: 'Not Implemented',
7071
502: 'Bad Gateway',

test/parallel/test-http-status-code.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var http = require('http');
77
// ServerResponse.prototype.statusCode
88

99
var testsComplete = 0;
10-
var tests = [200, 202, 300, 404, 500];
10+
var tests = [200, 202, 300, 404, 451, 500];
1111
var testIdx = 0;
1212

1313
var s = http.createServer(function(req, res) {
@@ -42,6 +42,6 @@ function nextTest() {
4242

4343

4444
process.on('exit', function() {
45-
assert.equal(4, testsComplete);
45+
assert.equal(5, testsComplete);
4646
});
4747

0 commit comments

Comments
 (0)