Changeset 6070 in josm for trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
- Timestamp:
- 2013-07-17T00:01:49+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r5889 r6070 92 92 * Add external request handler. Message can be suppressed. 93 93 * (for internal use) 94 * 94 * 95 95 * @param command The command to handle. 96 96 * @param handler The additional request handler. … … 138 138 out = new OutputStreamWriter(raw); 139 139 BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream(), "ASCII")); 140 140 141 141 String get = in.readLine(); 142 142 if (get == null) { … … 162 162 return; 163 163 } 164 164 165 165 int questionPos = url.indexOf('?'); 166 166 167 167 String command = questionPos < 0 ? url : url.substring(0, questionPos); 168 168 169 169 Map <String,String> headers = new HashMap<String, String>(); 170 170 int k=0, MAX_HEADERS=20; … … 178 178 } else break; 179 179 } 180 180 181 181 // Who sent the request: trying our best to detect 182 182 // not from localhost => sender = IP 183 183 // from localhost: sender = referer header, if exists 184 184 String sender = null; 185 185 186 186 if (!request.getInetAddress().isLoopbackAddress()) { 187 187 sender = request.getInetAddress().getHostAddress(); … … 197 197 if (sender == null) { 198 198 sender = "localhost"; 199 } 200 } 201 199 } 200 } 201 202 202 // find a handler for this command 203 203 Class<? extends RequestHandler> handlerClass = handlers.get(command);
Note:
See TracChangeset
for help on using the changeset viewer.
