MSB should pass the request with X_Driver_Parameter header to driver mgr. plugin
authorHuabingZhao <zhao.huabing@zte.com.cn>
Thu, 29 Sep 2016 11:43:46 +0000 (19:43 +0800)
committerHuabingZhao <zhao.huabing@zte.com.cn>
Thu, 29 Sep 2016 11:43:55 +0000 (19:43 +0800)
Issue-Id: OCS-94
Change-Id: If86c076cef537c6d9ff1b122f5b63653e62ba599
Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
msb-core/eag-openresty-ext/src/assembly/resources/openresty/nginx/sites-enabled/openomsb.conf
msb-core/openresty-ext/src/assembly/resources/openresty/nginx/sites-enabled/openomsb.conf

index 2b9f806..c0ffe3c 100644 (file)
@@ -58,6 +58,15 @@ server {
                 proxy_pass http://$backend;
     }
    location ~ ^/openoapi/([^/]+)(/[Vv][^/]*)?(.*) {
+               
+               #Send requests to Driver Mgr. if 'X_Driver_Parameter' header found in the request
+               if ($http_X_Driver_Parameter) {
+                       access_by_lua_block {
+                       local driver_manager   =  require('plugins.driver_manager')
+                       driver_manager.access()
+                       }
+               }
+               
           set $apiname $1;
                  set $apiversion $2;
           set $apiserver "fallback";
index 0b9ddda..dd5375d 100644 (file)
@@ -58,6 +58,15 @@ server {
                 proxy_pass http://$backend;
     }
    location ~ ^/openoapi/([^/]+)(/[Vv][^/]*)?(.*) {
+               
+               #Send requests to Driver Mgr. if 'X_Driver_Parameter' header found in the request
+               if ($http_X_Driver_Parameter) {
+                       access_by_lua_block {
+                       local driver_manager   =  require('plugins.driver_manager')
+                       driver_manager.access()
+                       }
+               }
+               
           set $apiname $1;
                  set $apiversion $2;
           set $apiserver "fallback";