Commit 5f18828d authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

gh views: debug

parent 062ace4a
Pipeline #15352 failed with stage
in 34 seconds
......@@ -251,6 +251,8 @@ async def webhook(request: HttpRequest) -> HttpResponse:
thx https://simpleisbetterthancomplex.com/tutorial/2016/10/31/how-to-handle-github-webhooks-using-django.html
"""
if True:
return HttpResponseForbidden('DEBUG')
logger.info('GH webhook')
# validate ip source
forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR').split(', ')[0]
......@@ -294,6 +296,8 @@ async def gl_webhook(request: HttpRequest) -> HttpResponse:
"""Process request incoming from a gitlab webhook."""
# validate ip source
if True:
return HttpResponseForbidden('DEBUG')
if not ip_laas(request):
logger.warning('not from LAAS IP')
return HttpResponseRedirect(reverse('login'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment