-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This updates the Jersey dependency from 1.x to 2.x. This commit requires OF-2352 / igniterealtime/Openfire#1945 which means that this PR will _not_ work with 4.7.0 beta (but hopefully will with 4.7.0 non-beta).
- Loading branch information
1 parent
e8b3d6c
commit 2ce034b
Showing
14 changed files
with
110 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 12 additions & 15 deletions
27
src/java/org/jivesoftware/openfire/plugin/rest/CORSFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
package org.jivesoftware.openfire.plugin.rest; | ||
|
||
import com.sun.jersey.spi.container.ContainerRequest; | ||
import com.sun.jersey.spi.container.ContainerResponse; | ||
import com.sun.jersey.spi.container.ContainerResponseFilter; | ||
import javax.annotation.Priority; | ||
import javax.ws.rs.Priorities; | ||
import javax.ws.rs.container.ContainerRequestContext; | ||
import javax.ws.rs.container.ContainerResponseContext; | ||
import javax.ws.rs.container.ContainerResponseFilter; | ||
import java.io.IOException; | ||
|
||
/** | ||
* The Class CORSFilter. | ||
*/ | ||
@Priority(Priorities.HEADER_DECORATOR) | ||
public class CORSFilter implements ContainerResponseFilter { | ||
|
||
/* (non-Javadoc) | ||
* @see com.sun.jersey.spi.container.ContainerResponseFilter#filter(com.sun.jersey.spi.container.ContainerRequest, com.sun.jersey.spi.container.ContainerResponse) | ||
*/ | ||
@Override | ||
public ContainerResponse filter(ContainerRequest request, ContainerResponse response) { | ||
response.getHttpHeaders().add("Access-Control-Allow-Origin", "*"); | ||
response.getHttpHeaders().add("Access-Control-Allow-Headers", | ||
"origin, content-type, accept, authorization"); | ||
response.getHttpHeaders().add("Access-Control-Allow-Credentials", "true"); | ||
response.getHttpHeaders().add("Access-Control-Allow-Methods", | ||
"GET, POST, PUT, DELETE, OPTIONS, HEAD"); | ||
|
||
return response; | ||
public void filter(ContainerRequestContext requestContext, ContainerResponseContext response) throws IOException { | ||
response.getHeaders().add("Access-Control-Allow-Origin", "*"); | ||
response.getHeaders().add("Access-Control-Allow-Headers", "origin, content-type, accept, authorization"); | ||
response.getHeaders().add("Access-Control-Allow-Credentials", "true"); | ||
response.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/java/org/jivesoftware/openfire/plugin/rest/entity/GroupEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/java/org/jivesoftware/openfire/plugin/rest/entity/MUCRoomEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/java/org/jivesoftware/openfire/plugin/rest/entity/OccupantEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/java/org/jivesoftware/openfire/plugin/rest/entity/ParticipantEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/java/org/jivesoftware/openfire/plugin/rest/entity/SecurityAuditLogs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/java/org/jivesoftware/openfire/plugin/rest/entity/SessionEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/java/org/jivesoftware/openfire/plugin/rest/entity/UserEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.