mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Pre formatting Bottle tests
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
argumentToEnsureNotTaintedNotMarkedAsSpurious
|
||||
untaintedArgumentToEnsureTaintedNotMarkedAsMissing
|
||||
testFailures
|
||||
failures
|
||||
@@ -0,0 +1,2 @@
|
||||
import experimental.meta.InlineTaintTest
|
||||
import MakeInlineTaintTest<TestTaintTrackingConfig>
|
||||
@@ -0,0 +1,10 @@
|
||||
import bottle
|
||||
from bottle import Bottle, response, request
|
||||
|
||||
app = Bottle()
|
||||
@app.route('/test', method=['OPTIONS', 'GET']) # $ routeSetup="/test"
|
||||
def test1(): # $ requestHandler
|
||||
response.headers['Content-type'] = 'application/json' # $ headerWriteName='Content-type' headerWriteValue='application/json'
|
||||
return '[1]' # $ HttpResponse responseBody='[1]' mimetype=text/html
|
||||
|
||||
app.run()
|
||||
21
python/ql/test/library-tests/frameworks/bottle/taint_test.py
Normal file
21
python/ql/test/library-tests/frameworks/bottle/taint_test.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import bottle
|
||||
from bottle import response, request
|
||||
|
||||
|
||||
app = bottle.app()
|
||||
@app.route('/test', method=['OPTIONS', 'GET']) # $ routeSetup="/test"
|
||||
def test1(): # $ requestHandler
|
||||
|
||||
ensure_tainted(
|
||||
request.headers, # $ tainted
|
||||
request.headers, # $ tainted
|
||||
request.forms, # $ tainted
|
||||
request.params, # $ tainted
|
||||
request.url, # $ tainted
|
||||
request.body, # $ tainted
|
||||
request.fullpath, # $ tainted
|
||||
request.query_string # $ tainted
|
||||
)
|
||||
return '[1]' # $ HttpResponse mimetype=text/html responseBody='[1]'
|
||||
|
||||
app.run()
|
||||
Reference in New Issue
Block a user