|
|
@ -29,7 +29,6 @@ import java.util.jar.Manifest; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.third.socketio.Configuration; |
|
|
|
import com.fr.third.socketio.Configuration; |
|
|
|
import com.fr.third.socketio.Transport; |
|
|
|
import com.fr.third.socketio.Transport; |
|
|
|
import com.fr.third.springframework.beans.propertyeditors.StringArrayPropertyEditor; |
|
|
|
|
|
|
|
import io.netty.util.concurrent.Future; |
|
|
|
import io.netty.util.concurrent.Future; |
|
|
|
import io.netty.util.concurrent.GenericFutureListener; |
|
|
|
import io.netty.util.concurrent.GenericFutureListener; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
@ -81,6 +80,8 @@ public class EncoderHandler extends ChannelOutboundHandlerAdapter { |
|
|
|
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(EncoderHandler.class); |
|
|
|
private static final Logger log = LoggerFactory.getLogger(EncoderHandler.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String SEPARATOR_COMMA = ","; |
|
|
|
|
|
|
|
|
|
|
|
private final PacketEncoder encoder; |
|
|
|
private final PacketEncoder encoder; |
|
|
|
|
|
|
|
|
|
|
|
private String version; |
|
|
|
private String version; |
|
|
@ -208,7 +209,7 @@ public class EncoderHandler extends ChannelOutboundHandlerAdapter { |
|
|
|
if (!isEmpty(allowHeaders)) { |
|
|
|
if (!isEmpty(allowHeaders)) { |
|
|
|
String header = res.headers().get(HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS); |
|
|
|
String header = res.headers().get(HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS); |
|
|
|
if (!isEmpty(header)) { |
|
|
|
if (!isEmpty(header)) { |
|
|
|
header = header.trim() + StringArrayPropertyEditor.DEFAULT_SEPARATOR + configuration.getAccessControlAllowHeaders(); |
|
|
|
header = header.trim() + SEPARATOR_COMMA + configuration.getAccessControlAllowHeaders(); |
|
|
|
res.headers().set(HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS, header); |
|
|
|
res.headers().set(HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS, header); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
res.headers().set(HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS, configuration.getAccessControlAllowHeaders()); |
|
|
|
res.headers().set(HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS, configuration.getAccessControlAllowHeaders()); |
|
|
|