Example #1
0
def search():
    searchForm = SearchForm()
    if searchForm.validate_on_submit():
        if utils.banned_characters(searchForm.search.data):
            log.logger.critical('Malicious character detected in search')
            abort(404)
        if request.content_type != r'application/x-www-form-urlencoded':
            print('dd')
            abort(404)
        query = searchForm.search.data
        resp = make_response(redirect(url_for('search_result',query=escape(query))))
        return resp
Example #2
0
def search():
    searchForm = SearchForm()
    if searchForm.validate_on_submit():
        query = searchForm.search.data
        return redirect(url_for('search_result', query=query))