Skip to content

Commit ca13d15

Browse files
author
Jacob Shandling
committed
expect 403s on sw details pages instead of 404s
1 parent 44132fc commit ca13d15

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

frontend/pages/SoftwarePage/SoftwareOSDetailsPage/SoftwareOSDetailsPage.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ const SoftwareOSDetailsPage = ({
103103
enabled: !!osVersionIdFromURL,
104104
select: (data) => data.os_version,
105105
onError: (error) => {
106-
// 404s returned for both non-existent and non-accessable entities
106+
// 403s returned for both non-existent and non-accessable entities
107107
// which we intentionally handle with the same empty state for security
108-
if (isAxiosError(error) && error.response?.status !== 404) {
108+
if (isAxiosError(error) && error.response?.status !== 403) {
109109
handlePageError(error);
110110
}
111111
},
@@ -161,7 +161,7 @@ const SoftwareOSDetailsPage = ({
161161
onTeamChange={onTeamChange}
162162
/>
163163
)}
164-
{/* at this point, error can only be 404 per above handling */}
164+
{/* at this point, error can only be 403 per above handling */}
165165
{isOsVersionError ? (
166166
<DetailsNoHosts
167167
header="OS not detected"

frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareTitleDetailsPage.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ const SoftwareTitleDetailsPage = ({
7575
{
7676
select: (data) => data.software_title,
7777
onError: (error) => {
78-
// 404s returned for both non-existent and non-accessable entities
78+
// 403s returned for both non-existent and non-accessable entities
7979
// which we intentionally handle with the same empty state for security
80-
if (isAxiosError(error) && error.response?.status !== 404) {
80+
if (isAxiosError(error) && error.response?.status !== 403) {
8181
handlePageError(error);
8282
}
8383
},
@@ -109,7 +109,7 @@ const SoftwareTitleDetailsPage = ({
109109
onTeamChange={onTeamChange}
110110
/>
111111
)}
112-
{/* at this point, error can only be 404 per above handling */}
112+
{/* at this point, error can only be 403 per above handling */}
113113
{isSoftwareTitleError ? (
114114
<DetailsNoHosts
115115
header="Software not detected"

frontend/pages/SoftwarePage/SoftwareVersionDetailsPage/SoftwareVersionDetailsPage.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ const SoftwareVersionDetailsPage = ({
7878
{
7979
select: (data) => data.software,
8080
onError: (error) => {
81-
// 404s returned for both non-existent and non-accessable entities
81+
// 403s returned for both non-existent and non-accessable entities
8282
// which we intentionally handle with the same empty state for security
83-
if (isAxiosError(error) && error.response?.status !== 404) {
83+
if (isAxiosError(error) && error.response?.status !== 403) {
8484
handlePageError(error);
8585
}
8686
},
@@ -128,7 +128,7 @@ const SoftwareVersionDetailsPage = ({
128128
onTeamChange={onTeamChange}
129129
/>
130130
)}
131-
{/* at this point, error can only be 404 per above handling */}
131+
{/* at this point, error can only be 403 per above handling */}
132132
{isSoftwareVersionError ? (
133133
<DetailsNoHosts
134134
header="Software not detected"

frontend/pages/SoftwarePage/SoftwareVulnerabilityDetailsPage/SoftwareVulnerabilityDetailsPage.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ const SoftwareVulnerabilityDetailsPage = ({
8080
{
8181
select: (data) => data.vulnerability,
8282
onError: (error) => {
83-
// 404s returned for both non-existent and non-accessable entities
83+
// 403s returned for both non-existent and non-accessable entities
8484
// which we intentionally handle with the same empty state for security
85-
if (isAxiosError(error) && error.response?.status !== 404) {
85+
if (isAxiosError(error) && error.response?.status !== 403) {
8686
handlePageError(error);
8787
}
8888
},
@@ -137,7 +137,7 @@ const SoftwareVulnerabilityDetailsPage = ({
137137
onTeamChange={onTeamChange}
138138
/>
139139
)}
140-
{/* at this point, error can only be 404 per above handling */}
140+
{/* at this point, error can only be 403 per above handling */}
141141
{isVulnError ? (
142142
<DetailsNoHosts
143143
header="Vulnerability not detected"

0 commit comments

Comments
 (0)