MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / apply

Method apply

thirdparty/bottle/bottle.py:2391–2413  ·  view source on GitHub ↗
(self, callback, route)

Source from the content-addressed store, hash-verified

2389 " apply.")
2390
2391 def apply(self, callback, route):
2392 dumps = self.json_dumps
2393 if not self.json_dumps: return callback
2394
2395 @functools.wraps(callback)
2396 def wrapper(*a, **ka):
2397 try:
2398 rv = callback(*a, **ka)
2399 except HTTPResponse as resp:
2400 rv = resp
2401
2402 if isinstance(rv, dict):
2403 #Attempt to serialize, raises exception on failure
2404 json_response = dumps(rv)
2405 #Set content type only if serialization successful
2406 response.content_type = 'application/json'
2407 return json_response
2408 elif isinstance(rv, HTTPResponse) and isinstance(rv.body, dict):
2409 rv.body = dumps(rv.body)
2410 rv.content_type = 'application/json'
2411 return rv
2412
2413 return wrapper
2414
2415
2416class TemplatePlugin(object):

Callers 3

_make_callbackMethod · 0.45
_handleMethod · 0.45
_castMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected