Skip to content

Commit

Permalink
Revert ip address change (#27)
Browse files Browse the repository at this point in the history
* Revert "Use ip address from x forwarded for (#26)"

This reverts commit b5e26bb.

* revert the ip address change
  • Loading branch information
xinghengwang authored Oct 31, 2024
1 parent 2338bed commit 19aad51
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion esm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion esm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moesif-cloudflare",
"version": "2.0.1",
"version": "2.0.2",
"description": "Moesif API analytics and monetization integration for Cloudflare workers",
"main": "src/index.mjs",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion esm/src/batcher.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Batcher {
const moesifHeaders = {
Accept: 'application/json; charset=utf-8',
'X-Moesif-Application-Id': appId,
'User-Agent': 'moesif-cloudflare/2.0.1',
'User-Agent': 'moesif-cloudflare/2.0.2',
'X-Moesif-Cf-Install-Id': INSTALL_ID,
'X-Moesif-Cf-Install-Product': INSTALL_PRODUCT && INSTALL_PRODUCT.id,
'X-Moesif-Cf-Install-Type': 'esm',
Expand Down
2 changes: 1 addition & 1 deletion esm/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function moesifMiddleware(originalFetch, userOptions) {
uri: request.url,
verb: request.method,
headers: headersToObject(request.headers),
ip_address: request.headers.get('x-forwarded-for') || request.headers.get('cf-connecting-ip'),
ip_address: request.headers.get('cf-connecting-ip'),
},
response: response.isEmpty
? undefined
Expand Down
2 changes: 1 addition & 1 deletion legacy/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ async function makeMoesifEvent(request, response, before, after, txId, requestBo
uri: request.url,
verb: request.method,
headers: headersToObject(request.headers),
ip_address: request.headers.get('x-forwarded-for') || request.headers.get('cf-connecting-ip')
ip_address: request.headers.get('cf-connecting-ip')
},
response: response.isEmpty ? undefined : {
time: after,
Expand Down

0 comments on commit 19aad51

Please sign in to comment.