# | Line 232 | Line 232 | public class MiniWebServer extends Thread { | |
---|---|---|
232 | do { | |
233 | line = reader.readLine(); | |
234 | // ah, this contains the URL | |
235 | < | if(line.startsWith("GET")) { |
235 | > | if(line.startsWith("GET ")) { |
236 | // strip off "GET " | |
237 | url = line.substring(4); | |
238 | // strip off anything past the URL | |
239 | < | url = url.substring(0, url.lastIndexOf(' ')); |
239 | > | if(url.lastIndexOf(' ') != -1) { |
240 | > | url = url.substring(0, url.lastIndexOf(' ')); |
241 | > | } |
242 | } | |
243 | } while(!line.equals("")); | |
244 | // check the URL is allowed |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |