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

HttpCLient uses ByteArrayEntity when sync data #2287

Merged
merged 6 commits into from
Jun 10, 2020

Conversation

rushsky518
Copy link
Contributor

HttpCLient uses ByteArrayEntity when sync data

@rushsky518 rushsky518 closed this Jan 13, 2020
@rushsky518 rushsky518 reopened this Jan 13, 2020
@rushsky518 rushsky518 closed this Jan 14, 2020
@rushsky518 rushsky518 reopened this Jan 15, 2020
@rushsky518 rushsky518 closed this Jan 15, 2020
@rushsky518 rushsky518 reopened this Jan 15, 2020
@KomachiSion
Copy link
Collaborator

Can you create issue first to discuss why use ByteArrayEntity to replace StringEntity?

@KomachiSion KomachiSion self-requested a review June 10, 2020 06:18
@rushsky518
Copy link
Contributor Author

@KomachiSion

public StringEntity(final String string, final ContentType contentType) throws UnsupportedCharsetException {
	super();
	Args.notNull(string, "Source string");
	Charset charset = contentType != null ? contentType.getCharset() : null;
	if (charset == null) {
		charset = HTTP.DEF_CONTENT_CHARSET;
	}
	this.content = string.getBytes(charset);
	if (contentType != null) {
		setContentType(contentType.toString());
	}
}

byte[] -> String(char[]) -> byte[], this may be unnecessary.
And issue is #2237

@KomachiSion KomachiSion added this to the 1.3.1 milestone Jun 10, 2020
@KomachiSion KomachiSion merged commit f49eba3 into alibaba:develop Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

com.alibaba.nacos.naming.misc.HttpClient#httpPutLarge is a little odd
2 participants