

@app.route('/webmention', methods=['POST'])
def handleWebmention():
    app.logger.info(('handleWebmention [%s]' % request.method))
    if (request.method == 'POST'):
        valid = False
        source = request.form.get('source')
        target = request.form.get('target')
        vouch = request.form.get('vouch')
        app.logger.info(('source: %s target: %s vouch %s' % (source, target, vouch)))
        valid = validURL(target)
        app.logger.info(('valid? %s' % valid))
        if (valid == requests.codes.ok):
            if mention(vouch, target, vouch):
                return redirect(target)
            elif ((vouch is None) and cfg['require_vouch']):
                return ('Vouch required for webmention', 449)
            else:
                return ('Webmention is invalid', 400)
        else:
            return ('invalid post', 404)

dataset/ETHPy150Open bear/python-indieweb/indieweb.py handleWebmention/VarMisuse@141/197 `source`->`vouch`