From 752b953a0733f70dbad221b046e93df1dcfbea75 Mon Sep 17 00:00:00 2001
From: Almog Baku <almog.baku@gmail.com>
Date: Wed, 25 Mar 2015 14:53:31 +0200
Subject: [PATCH] fixes: not attaching `api_key` to query if empty

---
 Resources/views/layout.html.twig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig
index d258cb4..416a2d8 100755
--- a/Resources/views/layout.html.twig
+++ b/Resources/views/layout.html.twig
@@ -486,9 +486,10 @@
                     $('input, button', $(this)).attr('disabled', 'disabled');
 
                     // append the query authentication
-                    if (authentication_delivery == 'query') {
+                    var api_key_val = $('#api_key').val();
+                    if (authentication_delivery == 'query' && api_key_val.length>0) {
                         url += url.indexOf('?') > 0 ? '&' : '?';
-                        url += api_key_parameter + '=' + $('#api_key').val();
+                        url += api_key_parameter + '=' + api_key_val;
                     }
 
                     // prepare the api enpoint