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

Provide first class support for essential request and response properties #330

Merged
merged 5 commits into from
Jun 7, 2019

Conversation

Bhashinee
Copy link
Member

Purpose

Provide first class support for essential request and response properties in carbon message

Goals

Fix the issue : ballerina-platform/ballerina-lang#14953

if (value == null) {
return defaultValue;
return 200;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we use a constant?

@@ -89,7 +89,7 @@ public DefaultHttpClientConnector(ConnectionManager connectionManager, SenderCon
this.http2ConnectionManager = connectionManager.getHttp2ConnectionManager();
this.senderConfiguration = senderConfiguration;
initTargetChannelProperties(senderConfiguration);
if (Float.valueOf(senderConfiguration.getHttpVersion()) == Constants.HTTP_2_0) {
if (senderConfiguration.getHttpVersion().equals(Constants.HTTP_2_0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (senderConfiguration.getHttpVersion().equals(Constants.HTTP_2_0)) {
if (Constants.HTTP_2_0.equals(senderConfiguration.getHttpVersion())) {

@@ -95,11 +95,11 @@ public static void writeRequestHeaders(HttpCarbonMessage httpOutboundRequest,
}

private static void setHttpVersionProperty(HttpCarbonMessage httpOutboundRequest, String httpVersion) {
if (Float.valueOf(httpVersion) == Constants.HTTP_2_0) {
if (httpVersion.equals(Constants.HTTP_2_0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (httpVersion.equals(Constants.HTTP_2_0)) {
if (Constants.HTTP_2_0.equals(httpVersion)) {

@@ -95,7 +95,7 @@ public HttpClientChannelInitializer(SenderConfiguration senderConfiguration, Htt
this.connectionAvailabilityFuture = connectionAvailabilityFuture;

String httpVersion = senderConfiguration.getHttpVersion();
if (Float.valueOf(httpVersion) == Constants.HTTP_2_0) {
if (httpVersion.equals(Constants.HTTP_2_0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (httpVersion.equals(Constants.HTTP_2_0)) {
if (Constants.HTTP_2_0.equals(httpVersion)) {

@Bhashinee Bhashinee merged commit 319a59a into wso2:master Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants