Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
fix(handlers.js): protect Python import (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranrib authored Mar 24, 2019
1 parent 20f40ce commit 80b1b08
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ const DEFAULT_WRAPPERS = {

const WRAPPER_CODE = {
python: `
import epsagon
from RELATIVE_PATH import METHOD as METHOD_internal
METHOD = METHOD_internal
try:
import epsagon
null = None # used to ignore arguments
undefined = None # used to igone arguments
epsagon.init(
token='TOKEN',
app_name='APP_NAME',
collector_url=COLLECTOR_URL,
metadata_only=bool(METADATA_ONLY)
)
null = None # used to ignore arguments
undefined = None # used to ignore arguments
epsagon.init(
token='TOKEN',
app_name='APP_NAME',
collector_url=COLLECTOR_URL,
metadata_only=bool(METADATA_ONLY)
)
METHOD = epsagon.WRAPPER_TYPE(METHOD_internal)
METHOD = epsagon.WRAPPER_TYPE(METHOD_internal)
except:
print('Warning: Epsagon package not found. The function will not be monitored')
`,
node: `
const epsagon = require('epsagon');
Expand Down

0 comments on commit 80b1b08

Please sign in to comment.