Polish ServletServerHttpRequest query param handling

The method returning query parameters now returns only query string
parameters as opposed to any Servlet request parameter.

This commit also adds a ReadOnlyMultiValueMap.
This commit is contained in:
Rossen Stoyanchev
2013-08-02 17:40:08 -04:00
parent 9700f09fad
commit a03517fa35
10 changed files with 221 additions and 21 deletions

View File

@@ -33,6 +33,16 @@ import org.springframework.web.socket.WebSocketHandler;
public interface SockJsService {
/**
* Process a SockJS request.
*
* @param request the current request
* @param response the current response
* @param handler the handler to process messages with
*
* @throws IOException raised if writing the to response of the current request fails
* @throws SockJsProcessingException
*/
void handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler handler)
throws IOException, SockJsProcessingException;

View File

@@ -34,6 +34,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.InvalidMediaTypeException;
import org.springframework.http.MediaType;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
@@ -283,8 +284,8 @@ public abstract class AbstractSockJsService implements SockJsService {
try {
request.getHeaders();
}
catch (IllegalArgumentException ex) {
// Ignore invalid Content-Type (TODO)
catch (InvalidMediaTypeException ex) {
logger.warn("Invalid media type ignored: " + ex.getMediaType());
}
try {