Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC 2616 defines header values as case insensitive, so per default we… #1259

Open
wants to merge 1 commit into
base: 2.3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions modules/org.restlet/src/org/restlet/util/Series.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ private boolean equals(String value1, String value2, boolean ignoreCase) {
* Returns the first parameter found with the given name.
*
* @param name
* The parameter name (case sensitive).
* The parameter name (case insensitive).
* @return The first parameter found with the given name.
*/
public T getFirst(String name) {
return getFirst(name, false);
return getFirst(name, true);
}

/**
Expand All @@ -279,11 +279,11 @@ public T getFirst(String name, boolean ignoreCase) {
* Returns the value of the first parameter found with the given name.
*
* @param name
* The parameter name (case sensitive).
* The parameter name (case insensitive).
* @return The value of the first parameter found with the given name.
*/
public String getFirstValue(String name) {
return getFirstValue(name, false);
return getFirstValue(name, true);
}

/**
Expand Down Expand Up @@ -328,15 +328,15 @@ public String getFirstValue(String name, boolean ignoreCase,
* Returns the value of the first parameter found with the given name.
*
* @param name
* The parameter name (case sensitive).
* The parameter name (case insensitive).
* @param defaultValue
* The default value to return if no matching parameter found or
* if the parameter has a null value.
* @return The value of the first parameter found with the given name or the
* default value.
*/
public String getFirstValue(String name, String defaultValue) {
return getFirstValue(name, false, defaultValue);
return getFirstValue(name, true, defaultValue);
}

/**
Expand Down Expand Up @@ -413,11 +413,11 @@ public String getValues(String name, String separator, boolean ignoreCase) {
* name.
*
* @param name
* The parameter name to match (case sensitive).
* The parameter name to match (case insensitive).
* @return The array of values.
*/
public String[] getValuesArray(String name) {
return getValuesArray(name, false);
return getValuesArray(name, true);
}

/**
Expand Down Expand Up @@ -478,7 +478,7 @@ public String[] getValuesArray(String name, boolean ignoreCase,
* @return The array of values.
*/
public String[] getValuesArray(String name, String defaultValue) {
return getValuesArray(name, false, defaultValue);
return getValuesArray(name, true, defaultValue);
}

/**
Expand All @@ -504,11 +504,11 @@ public Map<String, String> getValuesMap() {
* Removes all the parameters with a given name.
*
* @param name
* The parameter name (case sensitive).
* The parameter name (case insensitive).
* @return True if the list changed.
*/
public boolean removeAll(String name) {
return removeAll(name, false);
return removeAll(name, true);
}

/**
Expand Down Expand Up @@ -541,11 +541,11 @@ public boolean removeAll(String name, boolean ignoreCase) {
* name ignoring the case.
*
* @param name
* The name of the entries to be removed (case sensitive).
* The name of the entries to be removed (case insensitive).
* @return false if no entry has been removed, true otherwise.
*/
public boolean removeFirst(String name) {
return removeFirst(name, false);
return removeFirst(name, true);
}

/**
Expand Down Expand Up @@ -576,7 +576,7 @@ public boolean removeFirst(String name, boolean ignoreCase) {
/**
* Replaces the value of the first parameter with the given name and removes
* all other parameters with the same name. The name matching is case
* sensitive.
* insensitive.
*
* @param name
* The parameter name.
Expand All @@ -585,7 +585,7 @@ public boolean removeFirst(String name, boolean ignoreCase) {
* @return The parameter set or added.
*/
public T set(String name, String value) {
return set(name, value, false);
return set(name, value, true);
}

/**
Expand Down Expand Up @@ -653,11 +653,11 @@ public Series<T> subList(int fromIndex, int toIndex) {
* Returns a list of all the values associated to the parameter name.
*
* @param name
* The parameter name (case sensitive).
* The parameter name (case insensitive).
* @return The list of values.
*/
public Series<T> subList(String name) {
return subList(name, false);
return subList(name, true);
}

/**
Expand Down