Skip to content

Commit

Permalink
Add test for #1076
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeChampion committed Oct 31, 2021
1 parent d1d09fb commit 05586bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test.js
Expand Up @@ -493,6 +493,18 @@ exercise.forEach(function(exerciseMode) {

assert.equal(req.headers.get('content-type'), 'application/x-www-form-urlencoded;charset=UTF-8')
})

featureDependent(test, !IEorEdge, 'construct with URLSearchParams body and headers object sets Content-Type header', function() {
var req = new Request('https://fetch.spec.whatwg.org/', {
method: 'post',
headers: {
"Accept": "text/html"
},
body: new URLSearchParams('a=1&b=2')
})

assert.equal(req.headers.get('content-type'), 'application/x-www-form-urlencoded;charset=UTF-8')
})

featureDependent(
test,
Expand Down

0 comments on commit 05586bd

Please sign in to comment.