diff --git a/Changelog.md b/Changelog.md index 8da6a5f5..0f4cbc54 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,11 @@ # Changelog +## 1.8.12 - 2019-06-07 +- Added back the workaround of uppercasing method names otherwise axios causes issues with signing requests for storage data plane libraries. + +## 1.8.11 - 2019-06-06 +- Moved testing dependent projects from a script to Azure Devops Pipeline + ## 1.8.10 - 2019-06-05 - `axios` changed the way it treats properties of the request config in `0.19.0`. Previously we were setting `trasnformResponse` to `undefined`. This would indicate `axios` to not transform (`JSON.parse()`) the response body. In `0.19.0`, they are setting the default response transformer if transformResponse is set to `undefined`. This breaks our pasrsing logic where we are doing `JSON.parse()` on `operationResponse.bodyAsText`. Moreover, we are exposing the `bodyAsText` property in the generated clients. Not populating this property or setting the value of this property to a parsed JSON would be a breaking change for our users. diff --git a/lib/axiosHttpClient.ts b/lib/axiosHttpClient.ts index 32a12113..33e1980f 100644 --- a/lib/axiosHttpClient.ts +++ b/lib/axiosHttpClient.ts @@ -143,7 +143,15 @@ export class AxiosHttpClient implements HttpClient { config.httpAgent = agent.agent; } } - + // This hack is still required with 0.19.0 version of axios since axios tries to merge the + // Content-Type header from it's config[""] where the method name is lower-case, + // into the request header. It could be possible that the Content-Type header is not present + // in the original request and this would create problems while creating the signature for + // storage data plane sdks. + axios.interceptors.request.use((config: AxiosRequestConfig) => ({ + ...config, + method: (config.method as Method) && (config.method as Method).toUpperCase() as Method + })); res = await axios.request(config); } catch (err) { if (err instanceof axios.Cancel) { diff --git a/lib/util/constants.ts b/lib/util/constants.ts index 972df557..b8884163 100644 --- a/lib/util/constants.ts +++ b/lib/util/constants.ts @@ -7,7 +7,7 @@ export const Constants = { * @const * @type {string} */ - msRestVersion: "1.8.11", + msRestVersion: "1.8.12", /** * Specifies HTTP. diff --git a/package.json b/package.json index 66dc5063..c4cb4541 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "email": "azsdkteam@microsoft.com", "url": "https://github.com/Azure/ms-rest-js" }, - "version": "1.8.11", + "version": "1.8.12", "description": "Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest", "tags": [ "isomorphic",