Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/handlers/acceptInvitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export const acceptInvitationHandler: HandlerMap["acceptInvitation"] = async (
throw e;
}

return empty(200, res);
return empty(204, res);
};
2 changes: 1 addition & 1 deletion backend/src/handlers/claimOrg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export const claimOrgHandler: HandlerMap["claimOrg"] = async (
}
throw e;
}
return empty(200, res);
return empty(204, res);
};
2 changes: 1 addition & 1 deletion backend/src/handlers/createAppGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const createAppGroupHandler: HandlerMap["createAppGroup"] = async (

try {
await createAppGroup(req.user.id, data.orgId, data.name, data.apps);
return empty(200, res);
return empty(204, res);
} catch (e) {
if (e instanceof AppCreateError) {
const ex = e.cause!;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers/deleteApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const deleteAppHandler: HandlerMap["deleteApp"] = async (
const appId = ctx.request.params.appId;
try {
await deleteApp(appId, req.user.id, ctx.request.requestBody.keepNamespace);
return empty(200, res);
return empty(204, res);
} catch (e) {
if (e instanceof AppNotFoundError) {
return json(404, res, { code: 404, message: "App not found" });
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers/deleteOrgByID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const deleteOrgByIDHandler: HandlerMap["deleteOrgByID"] = async (
}
}

return empty(200, res);
return empty(204, res);
};
4 changes: 2 additions & 2 deletions backend/src/handlers/githubWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export const githubWebhookHandler: HandlerMap["githubWebhook"] = async (

try {
await processGitHubWebhookPayload(requestType, action, JSON.parse(data));
return empty(200, res);
return empty(204, res);
} catch (e) {
if (e instanceof ValidationError) {
return json(400, res, { code: 400, message: e.message });
} else if (e instanceof AppNotFoundError) {
// GitHub sent a webhook about a repository, but it's not linked to any apps - nothing to do here
return empty(200, res);
return empty(204, res);
} else if (e instanceof UnknownWebhookRequestTypeError) {
// GitHub sent a webhook payload that we don't care about
return empty(422, res);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers/ingestLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ingestLogsHandler: HandlerMap["ingestLogs"] = async (
logType,
ctx.request.requestBody.lines,
);
return empty(200, res);
return empty(204, res);
} catch (e) {
if (e instanceof DeploymentNotFoundError) {
// No deployment matches the ID and secret
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers/setAppCD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const setAppCDHandler: HandlerMap["setAppCD"] = async (
req.user.id,
ctx.request.requestBody.enable,
);
return empty(200, res);
return empty(204, res);
} catch (e) {
if (e instanceof AppNotFoundError) {
return json(404, res, { code: 404, message: "App not found." });
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers/updateApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const updateAppHandler: HandlerMap["updateApp"] = async (
const appData = ctx.request.requestBody;
try {
await updateApp(ctx.request.params.appId, req.user.id, appData);
return empty(200, res);
return empty(204, res);
} catch (e) {
if (e instanceof AppNotFoundError) {
return json(404, res, { code: 404, message: "App not found" });
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handlers/updateDeployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const updateDeploymentHandler: HandlerMap["updateDeployment"] = async (
const { secret, status } = ctx.request.requestBody;
try {
await updateDeployment(secret, status);
return empty(200, res);
return empty(204, res);
} catch (e) {
if (e instanceof ValidationError) {
return json(404, res, { code: 400, message: e.message });
Expand Down
5 changes: 4 additions & 1 deletion backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ export const empty = <
: "Error: This status code expects a body in the OpenAPI spec. Use json() instead.",
res: HandlerResponse<ResMap>,
): HandlerResponse<ResMap> => {
return res.status(statusCode as unknown as number).end();
return res
.status(statusCode as unknown as number)
.setHeader("Content-Length", 0)
.end();
};

export const redirect = <
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/pages/app/OverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,10 @@ const RetryDeploymentPrompt = ({
onClick={async () => {
await updateApp({
params: { path: { appId: app.id } },
body: { config: app.config },
body: {
projectId: app.projectId,
config: app.config,
},
});
await refetchDeployments();
}}
Expand Down
20 changes: 10 additions & 10 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ paths:
- $ref: "./ghes-3.16.yaml#/components/schemas/webhook-repository-transferred"
- $ref: "./ghes-3.16.yaml#/components/schemas/webhook-repository-deleted"
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -386,7 +386,7 @@ paths:
description: Deletes organization by id
operationId: deleteOrgByID
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -433,7 +433,7 @@ paths:
format: int64
required: [unclaimedInstallationId]
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -532,7 +532,7 @@ paths:
description: Accepts an invitation
operationId: acceptInvitation
responses:
"200":
"204":
description: Success (invitation accepted)
"400":
description: Validation failed
Expand Down Expand Up @@ -1096,7 +1096,7 @@ paths:
- orgId
- apps
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -1167,7 +1167,7 @@ paths:
schema:
$ref: "#/components/schemas/AppUpdate"
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -1214,7 +1214,7 @@ paths:
type: boolean
required: [keepNamespace]
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -1262,7 +1262,7 @@ paths:
type: boolean
required: [enable]
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -1690,7 +1690,7 @@ paths:
description: The hostname of the pod that produced the log line, which should equal the pod name
type: string
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down Expand Up @@ -1836,7 +1836,7 @@ paths:
status:
type: string
responses:
"200":
"204":
description: Success
"400":
description: Validation failed
Expand Down
Loading