summaryrefslogtreecommitdiffstats
path: root/docshell/test/browser/file_basic_multipart.sjs
blob: 5e89b93948f6e575c2d692a57d29dd67e6a84285 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"use strict";

function handleRequest(request, response) {
  response.setHeader(
    "Content-Type",
    "multipart/x-mixed-replace;boundary=BOUNDARY",
    false
  );
  response.setStatusLine(request.httpVersion, 200, "OK");

  response.write(`--BOUNDARY
Content-Type: text/html

<h1>First</h1>
Will be replaced
--BOUNDARY
Content-Type: text/html

<h1>Second</h1>
This will stick around
--BOUNDARY
--BOUNDARY--
`);
}