Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Latest commit

 

History

History
28 lines (21 loc) · 598 Bytes

jsonp.md

File metadata and controls

28 lines (21 loc) · 598 Bytes

JSONP

Koala use koa-safe-jsonp for JSONP response.

By default, jsonp is disabled. To enable jsonp, install set options.jsonp = {jsonp options} at initialization. See jsonp options.

const app = koala({
  jsonp: {
    callback: 'callback'
  }
})

this.jsonp

Send the jsonp response.

app.use(function* () {
  this.jsonp = { name: 'fengmk2' }
})

Koala will handle all the security problems, like CVE-2014-4671.