Permalink
Browse files

Merge branch 'master' of github.com:wordnik/swagger-java-sample-app

  • Loading branch information...
2 parents 41ab974 + 724538c commit 6b4223d845fb0592b3a74fda9712096eee3fd86e @fehguy fehguy committed Oct 27, 2011
@@ -51,11 +51,15 @@ public void addUser(User user) {
}
public void removeUser(String username) {
+ User userToRemove = null;
for (User user : users) {
if (user.getUsername().equals(username)) {
- users.remove(user);
+ userToRemove = user;
}
}
+
+ if(userToRemove != null)
+ users.remove(userToRemove);
}
private static User createUser(long id, String username, String firstName,
@@ -27,6 +27,8 @@ public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
+ res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
+ res.addHeader("Access-Control-Allow-Headers", "Content-Type");
chain.doFilter(request, response);
}

0 comments on commit 6b4223d

Please sign in to comment.