| | |
| | | if(parts != null && parts.length > 1) { |
| | | token = parts[1].trim(); |
| | | } |
| | | } else { |
| | | // unschoen, aber fuer Image-Links in HTML-Inhalten |
| | | // mit Query versuchen |
| | | // z.B. |
| | | // GET /resource?access_token=mF_9.B5f-4.1JqM HTTP/1.1 |
| | | // Host: server.example.com |
| | | String query = exchange.getRequestURI().getQuery(); |
| | | if(query != null && query.toLowerCase().contains("access_token")) { |
| | | String[] parts = query.split("&"); |
| | | for(String part : parts) { |
| | | String[] keyVal = part.split("="); |
| | | if(keyVal[0].equalsIgnoreCase("access_token")) { |
| | | token = keyVal[1].trim(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return token; |
| | | } |