Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | $response = id(new AphrontJSONResponse()) | ||||
| 'x' => '<iframe>', | 'x' => '<iframe>', | ||||
| )); | )); | ||||
| $sink = new AphrontIsolatedHTTPSink(); | $sink = new AphrontIsolatedHTTPSink(); | ||||
| $sink->writeResponse($response); | $sink->writeResponse($response); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| 'for (;;);{"x":"\u003ciframe\u003e"}', | 'for (;;);{"x":"\u003ciframe\u003e"}', | ||||
| $sink->getEmittedData(), | $sink->getEmittedData(), | ||||
| 'JSONResponse should prevent content-sniffing attacks.'); | pht( | ||||
| '%s should prevent content-sniffing attacks.', | |||||
| 'JSONResponse')); | |||||
| } | } | ||||
| } | } | ||||