Fix HTTP 501 -> HTTP 400 suggestions in PR review
This commit is contained in:
parent
18030ba33e
commit
22bd8c4bf8
@ -39,7 +39,7 @@ class ChannelsRoutes {
|
|||||||
private async $getChannelsForNode(req: Request, res: Response) {
|
private async $getChannelsForNode(req: Request, res: Response) {
|
||||||
try {
|
try {
|
||||||
if (typeof req.query.public_key !== 'string') {
|
if (typeof req.query.public_key !== 'string') {
|
||||||
res.status(501).send('Missing parameter: public_key');
|
res.status(400).send('Missing parameter: public_key');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const index = parseInt(typeof req.query.index === 'string' ? req.query.index : '0', 10) || 0;
|
const index = parseInt(typeof req.query.index === 'string' ? req.query.index : '0', 10) || 0;
|
||||||
@ -57,7 +57,7 @@ class ChannelsRoutes {
|
|||||||
private async $getChannelsByTransactionIds(req: Request, res: Response) {
|
private async $getChannelsByTransactionIds(req: Request, res: Response) {
|
||||||
try {
|
try {
|
||||||
if (!Array.isArray(req.query.txId)) {
|
if (!Array.isArray(req.query.txId)) {
|
||||||
res.status(500).send('Not an array');
|
res.status(400).send('Not an array');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const txIds: string[] = [];
|
const txIds: string[] = [];
|
||||||
|
@ -16,7 +16,7 @@ class GeneralLightningRoutes {
|
|||||||
|
|
||||||
private async $searchNodesAndChannels(req: Request, res: Response) {
|
private async $searchNodesAndChannels(req: Request, res: Response) {
|
||||||
if (typeof req.query.searchText !== 'string') {
|
if (typeof req.query.searchText !== 'string') {
|
||||||
res.status(501).send('Missing parameter: searchText');
|
res.status(400).send('Missing parameter: searchText');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user