diff --git a/lib/wsapi.js b/lib/wsapi.js index 4e5452a57d34063c121bce30bdd1b9137b9fdca4..b9c5b50f7f384ec1f2fe5336cc165b27c4441585 100644 --- a/lib/wsapi.js +++ b/lib/wsapi.js @@ -346,7 +346,7 @@ exports.routeSetup = function (app, options) { } if (api.internal) { - return httputils.badRequest(resp, "internal api"); + return httputils.notFound(resp); } var destination_url = api.writes_db ? options.write_url + "/wsapi/" + operation diff --git a/tests/internal-wsapi-test.js b/tests/internal-wsapi-test.js new file mode 100644 index 0000000000000000000000000000000000000000..59d04ae2dad6f84e5c89a72d187c12f529e7eac5 --- /dev/null +++ b/tests/internal-wsapi-test.js @@ -0,0 +1,35 @@ +#!/usr/bin/env node + +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +require('./lib/test_env.js'); + +const +assert = require('assert'), +vows = require('vows'), +start_stop = require('./lib/start-stop.js'), +wsapi = require('./lib/wsapi.js'); + +var suite = vows.describe('internal-wsapi'); + +// disable vows (often flakey?) async error behavior +suite.options.error = false; + +start_stop.addStartupBatches(suite); + +suite.addBatch({ + "requesting to create an account with an assertion": { + topic: wsapi.post('/wsapi/create_account_with_assertion', { }), + "returns a 404": function(err, r) { + assert.strictEqual(r.code, 404); + } + } +}); + +start_stop.addShutdownBatches(suite); + +// run or export the suite. +if (process.argv[1] === __filename) suite.run(); +else suite.export(module);