Skip to content

Commit

Permalink
HttpMethod#matches compares by String equality
Browse files Browse the repository at this point in the history
Closes gh-26834
  • Loading branch information
rstoyanchev committed May 4, 2021
1 parent 55faf6e commit b76e0c4
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,14 +57,13 @@ public static HttpMethod resolve(@Nullable String method) {


/**
* Determine whether this {@code HttpMethod} matches the given
* method value.
* @param method the method value as a String
* Determine whether this {@code HttpMethod} matches the given method value.
* @param method the HTTP method as a String
* @return {@code true} if it matches, {@code false} otherwise
* @since 4.2.4
*/
public boolean matches(String method) {
return (this == resolve(method));
return name().equals(method);
}

}

0 comments on commit b76e0c4

Please sign in to comment.