Skip to content

Commit

Permalink
Fix failure when respose are empty on web connectivity measurement page
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Apr 11, 2024
1 parent e3ab23a commit f5185d9
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions components/measurement/nettests/WebConnectivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,22 @@ const RequestResponseContainer = ({request}) => {
</Box>
<Box width={1} mb={2} p={2} bg='gray2'>
<WrappedPre fontSize={14}>
{Object.keys(request.response.headers).map((header, index) => (
<React.Fragment key={index}>
<Flex mb={2}>
<Box mr={1}>
<Text fontWeight='bold'>{header}:</Text>
</Box>
<Box>
{request.response.headers[header]}
</Box>
</Flex>
</React.Fragment>
))}
{
request.response.headers ?
Object.keys(request.response.headers).map((header, index) => (
<React.Fragment key={index}>
<Flex mb={2}>
<Box mr={1}>
<Text fontWeight='bold'>{header}:</Text>
</Box>
<Box>
{request.response.headers[header]}
</Box>
</Flex>
</React.Fragment>
)) :
<>Empty headers</>
}
</WrappedPre>
</Box>
{/* Response Body (HTML) */}
Expand Down

0 comments on commit f5185d9

Please sign in to comment.