http icon indicating copy to clipboard operation
http copied to clipboard

Http client not working with Two server including Loadbalancer with cookies

Open Ankit0080 opened this issue 3 years ago • 0 comments

So the app is requesting AWS server with loadbalancer also running, and passing the load balancer cookie inside request header is not working with http client . But when i disable loadbalancer from aws and hit only one server from http client it works. So the http client is not able to distinguish between actual server and loadbalancer . What's the solution for this. Thanks in advance

final dio = Dio();

// add the interceptor dio.interceptors.add(CurlLoggerDioInterceptor(printOnSuccess: true));

dio.get(apiUrl,
    options: Options(
      headers: {
        "sessionId": userId,
        'Content-Type': 'application/json',
        sakaiSessionKey: sakaiSessionValue,
        awsSessionKey: awsSessionValue,
      },
    ));

var response = await http.get(Uri.parse(apiUrl), headers: {
  "sessionId": userId,
  'Content-Type': 'application/json',
  // awsSessionKey: awsSessionValue,
  // sakaiSessionKey: sakaiSessionValue
});

Ankit0080 avatar Jan 14 '22 12:01 Ankit0080