Compare commits
No commits in common. "573e0edf5f5811defcac8d88db0356611f473fc9" and "1016c270856ffae3071cba0237cee079888d3085" have entirely different histories.
573e0edf5f
...
1016c27085
|
@ -247,7 +247,7 @@ export const InvalidURI: ErrorFormat = {
|
|||
description: "Couldn't parse the specified URI.",
|
||||
};
|
||||
|
||||
export const KeyTooLongError: ErrorFormat = {
|
||||
export const KeyTooLong: ErrorFormat = {
|
||||
code: 400,
|
||||
description: 'Your key is too long.',
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as http from 'http';
|
|||
export default function routeDELETE(
|
||||
request: http.IncomingMessage,
|
||||
response: http.ServerResponse,
|
||||
api: routesUtils.ApiMethods,
|
||||
api: { callApiMethod: routesUtils.CallApiMethod },
|
||||
log: RequestLogger,
|
||||
statsClient?: StatsClient,
|
||||
) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import StatsClient from '../../metrics/StatsClient';
|
|||
export default function routerGET(
|
||||
request: http.IncomingMessage,
|
||||
response: http.ServerResponse,
|
||||
api: routesUtils.ApiMethods,
|
||||
api: { callApiMethod: routesUtils.CallApiMethod },
|
||||
log: RequestLogger,
|
||||
statsClient?: StatsClient,
|
||||
dataRetrievalParams?: any,
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as http from 'http';
|
|||
export default function routeHEAD(
|
||||
request: http.IncomingMessage,
|
||||
response: http.ServerResponse,
|
||||
api: routesUtils.ApiMethods,
|
||||
api: { callApiMethod: routesUtils.CallApiMethod },
|
||||
log: RequestLogger,
|
||||
statsClient?: StatsClient,
|
||||
) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import StatsClient from '../../metrics/StatsClient';
|
|||
export default function routeOPTIONS(
|
||||
request: http.IncomingMessage,
|
||||
response: http.ServerResponse,
|
||||
api: routesUtils.ApiMethods,
|
||||
api: { callApiMethod: routesUtils.CallApiMethod },
|
||||
log: RequestLogger,
|
||||
statsClient?: StatsClient,
|
||||
) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as http from 'http';
|
|||
export default function routePOST(
|
||||
request: http.IncomingMessage,
|
||||
response: http.ServerResponse,
|
||||
api: routesUtils.ApiMethods,
|
||||
api: { callApiMethod: routesUtils.CallApiMethod },
|
||||
log: RequestLogger,
|
||||
) {
|
||||
log.debug('routing request', { method: 'routePOST' });
|
||||
|
@ -59,7 +59,7 @@ export default function routePOST(
|
|||
}
|
||||
|
||||
if (objectKey === undefined && Object.keys(query).length === 0) {
|
||||
return api.callPostObject!(request, response, log, (err, resHeaders) => routesUtils.responseNoBody(err, resHeaders, response, 204, log));
|
||||
return api.callApiMethod('objectPost', request, response, log, (err, resHeaders) => routesUtils.responseNoBody(err, resHeaders, response, 204, log));
|
||||
}
|
||||
|
||||
return routesUtils.responseNoBody(errors.NotImplemented, null, response,
|
||||
|
|
|
@ -8,7 +8,7 @@ import StatsClient from '../../metrics/StatsClient';
|
|||
export default function routePUT(
|
||||
request: http.IncomingMessage,
|
||||
response: http.ServerResponse,
|
||||
api: routesUtils.ApiMethods,
|
||||
api: { callApiMethod: routesUtils.CallApiMethod },
|
||||
log: RequestLogger,
|
||||
statsClient?: StatsClient,
|
||||
) {
|
||||
|
|
|
@ -10,11 +10,6 @@ import * as constants from '../constants';
|
|||
import DataWrapper from '../storage/data/DataWrapper';
|
||||
import StatsClient from '../metrics/StatsClient';
|
||||
|
||||
export type ApiMethods = {
|
||||
callApiMethod: CallApiMethod;
|
||||
callPostObject?: CallPostObject;
|
||||
};
|
||||
|
||||
export type CallApiMethod = (
|
||||
methodName: string,
|
||||
request: http.IncomingMessage,
|
||||
|
@ -23,14 +18,6 @@ export type CallApiMethod = (
|
|||
callback: (err: ArsenalError | null, ...data: any[]) => void,
|
||||
) => void;
|
||||
|
||||
export type CallPostObject = (
|
||||
request: http.IncomingMessage,
|
||||
response: http.ServerResponse,
|
||||
log: RequestLogger,
|
||||
callback: (err: ArsenalError | null, ...data: any[]) => void,
|
||||
) => void;
|
||||
|
||||
|
||||
/**
|
||||
* setCommonResponseHeaders - Set HTTP response headers
|
||||
* @param headers - key and value of new headers to add
|
||||
|
|
Loading…
Reference in New Issue