Comparison

mod_auth_http_cookie/mod_auth_http_cookie.lua @ 3223:9a89ec5030b5

mod_auth_http_cookie: Try to get HTTP request from array on BOSH sessions This looks like a cleaner way. `session.requests` appears to have been around a longer time than `_http_open_response`.
author Kim Alvefur <zash@zash.se>
date Fri, 10 Aug 2018 06:10:38 +0200
parent 3037:bae7b0a002ef
child 3224:b7aa8630438e
comparison
equal deleted inserted replaced
3222:c22b6283d226 3223:9a89ec5030b5
140 function provider.delete_user(username) 140 function provider.delete_user(username)
141 return nil , "User deletion not supported"; 141 return nil , "User deletion not supported";
142 end 142 end
143 143
144 local function get_session_cookies(session) 144 local function get_session_cookies(session)
145 local response = session.conn._http_open_response; 145 local request = session.requests[1];
146 local request = response and response.request; 146 end
147 if not request and session.conn._http_open_response then -- Fallback BOSH
148 local response = session.conn._http_open_response;
149 request = response and response.request;
150 end
147 if request then 151 if request then
148 return request.headers.cookie; 152 return request.headers.cookie;
149 end 153 end
150 end 154 end
151 155