Skip to content

Conversation

@ndaidong
Copy link
Collaborator

  • Add fetchOptions parameter
    • Allow to pass request to proxy
  • Add more examples

- Add fetchOptions parameter
- Allow to pass request to proxy
- Add new example
@coveralls
Copy link

coveralls commented Sep 22, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling 910d313 on 6.1.1 into ad4911b on main.

const headers = {
'Accept-Charset': 'utf-8'
}
const data = await got(url, { headers }).text()

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on [a user-provided value](2).
proxy = null
} = options

const res = proxy ? await profetch(url, proxy) : await fetch(url, { headers })

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on [a user-provided value](2). The [URL](1) of this request depends on [a user-provided value](3).
app.get('/proxy/getxml', async (req, res) => {
const url = req.query.url
const xml = await loadRemoteFeed(url)
return res.type('text/xml').send(xml)

Check warning

Code scanning / CodeQL

Exception text reinterpreted as HTML

[Exception text](1) is reinterpreted as HTML without escaping meta-characters.
@ndaidong ndaidong merged commit 084a26d into main Sep 22, 2022
@ndaidong ndaidong deleted the 6.1.1 branch September 25, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants