parent
7497391497
commit
0451232eb4
|
@ -20,7 +20,6 @@ import java.io.PrintWriter;
|
|||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -63,6 +62,7 @@ public class EmbeddedDatabaseFactory {
|
|||
*/
|
||||
public static final String DEFAULT_DATABASE_NAME = "testdb";
|
||||
|
||||
|
||||
private static final Log logger = LogFactory.getLog(EmbeddedDatabaseFactory.class);
|
||||
|
||||
private String databaseName = DEFAULT_DATABASE_NAME;
|
||||
|
|
|
@ -155,12 +155,15 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
|||
*/
|
||||
public List<MediaType> getAccept() {
|
||||
String value = getFirst(ACCEPT);
|
||||
List<MediaType> result = (value != null) ? MediaType.parseMediaTypes(value) : Collections.<MediaType>emptyList();
|
||||
List<MediaType> result = (value != null ? MediaType.parseMediaTypes(value) : Collections.<MediaType>emptyList());
|
||||
|
||||
// Some containers parse 'Accept' into multiple values
|
||||
if ((result.size() == 1) && (get(ACCEPT).size() > 1)) {
|
||||
value = StringUtils.collectionToCommaDelimitedString(get(ACCEPT));
|
||||
result = MediaType.parseMediaTypes(value);
|
||||
if (result.size() == 1) {
|
||||
List<String> acceptHeader = get(ACCEPT);
|
||||
if (acceptHeader.size() > 1) {
|
||||
value = StringUtils.collectionToCommaDelimitedString(acceptHeader);
|
||||
result = MediaType.parseMediaTypes(value);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue