Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit18193c5

Browse files
authored
fix v2.6.3 that did not sending query params (#1301)
1 parentace7536 commit18193c5

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

‎CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Changelog
55

66
#2.x release
77

8+
##v2.6.4
9+
10+
- Hotfix: fix v2.6.3 that did not sending query params
11+
812
##v2.6.3
913

1014
- Fix: properly encode url with unicode characters

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"node-fetch",
3-
"version":"2.6.3",
3+
"version":"2.6.4",
44
"description":"A light-weight module that brings window.fetch to node.js",
55
"main":"lib/index.js",
66
"browser":"./browser.js",

‎src/request.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,7 @@ function parseURL(urlStr) {
3333
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
3434
*/
3535
if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)){
36-
consturl=newURL(urlStr);
37-
38-
return{
39-
path:url.pathname,
40-
pathname:url.pathname,
41-
hostname:url.hostname,
42-
protocol:url.protocol,
43-
port:url.port,
44-
hash:url.hash,
45-
search:url.search,
46-
query:url.query,
47-
href:url.href,
48-
}
36+
urlStr=newURL(urlStr).toString()
4937
}
5038

5139
// Fallback to old implementation for arbitrary URLs

‎test/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,15 @@ describe('external encoding', () => {
28472847
});
28482848

28492849
describe('issue #1290',function(){
2850+
2851+
it('should keep query params',function(){
2852+
returnfetch(`${base}inspect?month=2021-09`)
2853+
.then(res=>res.json())
2854+
.then(json=>{
2855+
expect(json.url).to.equal('/inspect?month=2021-09')
2856+
})
2857+
})
2858+
28502859
it('should handle escaped unicode in URLs',()=>{
28512860
consturl=`${base}issues/1290/%E3%81%B2%E3%82%89%E3%81%8C%E3%81%AA`;
28522861
returnfetch(url).then((res)=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp