Add 'User-Agent' header to CLI REST calls
Update the InitializrService so that a 'SpringBootCli' User-Agent header is sent with each request. This should allow the server-side code to gracefully evolve the JSON format if needed. Fixes gh-1869
This commit is contained in:
@@ -141,6 +141,8 @@ class InitializrService {
|
||||
private CloseableHttpResponse execute(HttpUriRequest request, Object url,
|
||||
String description) {
|
||||
try {
|
||||
request.addHeader("User-Agent", "SpringBootCli/"
|
||||
+ getClass().getPackage().getImplementationVersion());
|
||||
return getHttp().execute(request);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
|
||||
Reference in New Issue
Block a user