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

Add TRACE, CONNECT, and PATCH http methods #31035

Merged
merged 3 commits into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,19 @@ public Method method() {
return Method.OPTIONS;
}

return Method.GET;
if (httpMethod == HttpMethod.PATCH) {
return Method.PATCH;
}

if (httpMethod == HttpMethod.TRACE) {
return Method.TRACE;
}

if (httpMethod == HttpMethod.CONNECT) {
return Method.CONNECT;
}

throw new IllegalArgumentException("Unexpected http method: " + httpMethod);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public class NioHttpRequest extends RestRequest {
}
}

@Override
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still @Override?

public Method method() {
HttpMethod httpMethod = request.method();
if (httpMethod == HttpMethod.GET)
Expand All @@ -84,7 +83,19 @@ public Method method() {
return Method.OPTIONS;
}

return Method.GET;
if (httpMethod == HttpMethod.PATCH) {
return Method.PATCH;
}

if (httpMethod == HttpMethod.TRACE) {
return Method.TRACE;
}

if (httpMethod == HttpMethod.CONNECT) {
return Method.CONNECT;
}

throw new IllegalArgumentException("Unexpected http method: " + httpMethod);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public RestRequest(
}

public enum Method {
GET, POST, PUT, DELETE, OPTIONS, HEAD
GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, TRACE, CONNECT
}

public abstract Method method();
Expand Down