Changeset 9935 in josm for trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
- Timestamp:
- 2016-03-05T21:36:33+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r9913 r9935 7 7 import java.io.IOException; 8 8 import java.lang.reflect.Field; 9 import java.net.CookieHandler; 9 10 import java.net.HttpURLConnection; 11 import java.net.URISyntaxException; 10 12 import java.net.URL; 11 13 import java.nio.charset.StandardCharsets; 14 import java.util.Collections; 12 15 import java.util.HashMap; 13 16 import java.util.Iterator; … … 199 202 } 200 203 201 protected SessionId extractOsmSession() { 202 List<String> setCookies = connection.getResponse().getHeaderFields().get("Set-Cookie"); 204 protected SessionId extractOsmSession() throws IOException, URISyntaxException { 205 // response headers might not contain the cookie, see #12584 206 final List<String> setCookies = CookieHandler.getDefault() 207 .get(connection.getURL().toURI(), Collections.<String, List<String>>emptyMap()) 208 .get("Cookie"); 203 209 if (setCookies == null) { 204 210 Main.warn("No 'Set-Cookie' in response header!"); … … 267 273 tr("OSM website did not return a session cookie in response to ''{0}'',", url.toString())); 268 274 return sessionId; 269 } catch (IOException e) {275 } catch (IOException | URISyntaxException e) { 270 276 throw new OsmOAuthAuthorizationException(e); 271 277 } finally {
Note:
See TracChangeset
for help on using the changeset viewer.