-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 utility class which contains methods which helps to convert HTTP1… #82
Conversation
…/x to BHTTP messages. Motivation: Often people need to translate from HTTP1/x to BHTTP, we should provide utilities for this. Modifications: Add BinaryHttpConvert class which contain various static helper methods Result: Easily be able to convert from HTTP1/x to BHTTP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
codec-bhttp/src/main/java/io/netty/incubator/codec/bhttp/BinaryHttpConverter.java
Show resolved
Hide resolved
} | ||
|
||
/** | ||
* Creates a {@link FullBinaryHttpResponse} from the given {@link FullHttpRequest}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{@link FullHttpRequest}
-> {@link FullHttpResponse}
* @return the created response. | ||
*/ | ||
public static BinaryHttpResponse convert(HttpResponse response) { | ||
if (response instanceof FullBinaryHttpRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FullHttpResponse
* @return the created request. | ||
*/ | ||
public static BinaryHttpRequest convert(HttpRequest request, String scheme, String authority) { | ||
if (request instanceof FullBinaryHttpRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FullHttpRequest
…/x to BHTTP messages.
Motivation:
Often people need to translate from HTTP1/x to BHTTP, we should provide utilities for this.
Modifications:
Add BinaryHttpConvert class which contain various static helper methods
Result:
Easily be able to convert from HTTP1/x to BHTTP.