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 changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
added reset message on error because if the message got deleted then it would give an error
added request response headers into request project
3 changes: 2 additions & 1 deletion src/routes/api/v1/unauthed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ router.post("/request", async (req: Request, res: Response) => {
}
res.json({
status: response.status,
body: resBody
body: resBody,
headers: Object.fromEntries(response.headers.entries())
});
}
catch (error){
Expand Down
2 changes: 1 addition & 1 deletion views/projects/request.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

const json = await response.json();
if(response.ok){
result.innerHTML = `Status code: ${json.status}<br><br>Body: <br>${JSON.stringify(json.body)}`;
result.innerHTML = `Status code: ${json.status}<br><br>Body: <br>${JSON.stringify(json.body)}<br>Response Headers:<br>${JSON.stringify(json.headers)}`;
}
else{
result.innerText = `There was an error while sending the api request: ${json.error}`;
Expand Down