Skip to content

Commit

Permalink
log ip
Browse files Browse the repository at this point in the history
  • Loading branch information
nbittich committed Feb 24, 2024
1 parent 1d41a12 commit 97de5b3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export async function getPublicInformation(ipAddr = null) {
method: "GET",
headers: ipAddr
? {
"X-Forwarded-For": ipAddr,
}
"X-Forwarded-For": ipAddr,
}
: {},
});
return await response.json();
Expand All @@ -25,8 +25,8 @@ export async function gallery(page = 0, pageSize = 6, ipAddr) {
method: "GET",
headers: ipAddr
? {
"X-Forwarded-For": ipAddr,
}
"X-Forwarded-For": ipAddr,
}
: {},
});
const data = await response.json();
Expand All @@ -44,8 +44,8 @@ export async function download(id, ipAddr = null) {
method: "GET",
headers: ipAddr
? {
"X-Forwarded-For": ipAddr,
}
"X-Forwarded-For": ipAddr,
}
: {},
},
);
Expand Down Expand Up @@ -79,12 +79,15 @@ export async function getBlogPosts(
}
export async function getBlogPost(id, slug, ipAddr) {
const url = `${BACKEND_URL}/api/blog/post/${slug}/${id}`;
if (ipAddr) {
console.log(`[${ipAddr}]: getBlogPost ${id}`);
}
const response = await fetch(url, {
method: "GET",
headers: ipAddr
? {
"X-Forwarded-For": ipAddr,
}
"X-Forwarded-For": ipAddr,
}
: {},
});
const json = await response.json();
Expand Down

0 comments on commit 97de5b3

Please sign in to comment.