|
2 | 2 | // Licensed under the MIT license.
|
3 | 3 |
|
4 | 4 | import { ServiceClient } from "@azure/core-client";
|
| 5 | +import { createPipelineRequest } from "@azure/core-rest-pipeline"; |
| 6 | +import { expect } from "chai"; |
5 | 7 | import { CustomMatcherOptions, isPlaybackMode, Recorder } from "../src";
|
6 | 8 | import { isLiveMode, TestMode } from "../src/utils/utils";
|
7 | 9 | import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./utils/utils";
|
@@ -90,6 +92,21 @@ import { getTestServerUrl, makeRequestAndVerifyResponse, setTestMode } from "./u
|
90 | 92 | );
|
91 | 93 | });
|
92 | 94 |
|
| 95 | + describe("does not add a content-length header unnecessarily", () => |
| 96 | + (["GET", "DELETE"] as const).forEach((method) => |
| 97 | + it(`to a ${method} request`, async () => { |
| 98 | + await recorder.start({ envSetupForPlayback: {} }); |
| 99 | + const req = createPipelineRequest({ |
| 100 | + url: getTestServerUrl() + "/content_length_test", |
| 101 | + method, |
| 102 | + allowInsecureConnection: isLiveMode(), |
| 103 | + }); |
| 104 | + |
| 105 | + const rsp = await client.sendRequest(req); |
| 106 | + expect(rsp.status).to.be.within(200, 299); |
| 107 | + }) |
| 108 | + )); |
| 109 | + |
93 | 110 | // Matchers
|
94 | 111 | describe("Matchers", () => {
|
95 | 112 | it("BodilessMatcher", async () => {
|
|
0 commit comments