Skip to content

Commit

Permalink
[JENKINS-72509] avoid broken log when deleting job/agent
Browse files Browse the repository at this point in the history
when accessing the log of a running build and the job gets deleted or
someone removes read permissions (without discover) the log just appends
the output of the call to logText/progressiveHtml which is the 404
message from Jenkins.
The same happens when one accesses the log of an agent and the agent is
deleted.
This is due to only checking for 403 status and ignoring other status
codes from the 400 range.
  • Loading branch information
mawinter69 committed Jan 28, 2024
1 parent f640efc commit 1ab9182
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/resources/lib/hudson/progressive-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Behaviour.specify(
}, 1000);
return;
}
if (rsp.status === 403) {
// likely an expired crumb
if (rsp.status >= 400) {
// An expired crumb, job/agent deleted or removed permissions
location.reload();
return;
}
Expand Down

0 comments on commit 1ab9182

Please sign in to comment.