42 lines
744 B
Plaintext
42 lines
744 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,python]
|
|
----
|
|
from flask import request, current_app
|
|
import logging
|
|
|
|
@app.route('/log')
|
|
def log():
|
|
input = request.args.get('input')
|
|
current_app.logger.error("%s", input) # Noncompliant
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,python]
|
|
----
|
|
from flask import request, current_app
|
|
import logging
|
|
|
|
@app.route('/log')
|
|
def log():
|
|
input = request.args.get('input')
|
|
if input.isalnum():
|
|
current_app.logger.error("%s", input) # Compliant
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|