Repository navigation
How is the URL build in got? Part 3 #1607
Describe the bug#1546 continue from
Actual behaviorhttp://somehost/?q=%B4%BA%BD%BA Expected behaviorhttp://somehost/?q=%B4%BA%BD%BA Code to reproduceconst got = require('got');
(async () => {
a = await got(
'https://search.naver.com/search.naver?sm=tab_hty.top&where=nexearch&query=%B4%BA%BD%BA&oquery=%ED%95%9C%EA%B8%80+%EC%9D%B8%EC%BD%94%EB%94%A9&tqi=huRGOwprvhGssA7smnNssssstrs-353069'
);
})();Checklist
|
Replies: 5 comments
|
source/core/index.ts:1453 if (this.options && this.options.skipDecodeURI === true) {
// if skipDecodeURI is set to true then do not decode it will avoid some decoding errors
} else {
decodeURI(this.requestUrl);
}const got = require('got');
(async () => {
a = await got(
'https://search.naver.com/search.naver?sm=tab_hty.top&where=nexearch&query=%B4%BA%BD%BA&oquery=%ED%95%9C%EA%B8%80+%EC%9D%B8%EC%BD%94%EB%94%A9&tqi=huRGOwprvhGssA7smnNssssstrs-353069',
{ skipDecodeURI: true }
);
})();that solves the problem. |
|
Got is just an HTTP client, the answer is in the specification, you should look there instead unless you find something against the spec. |
|
hmmm I understand the spec but this problem is more for the language specific. when korean language is encoded it will encode the say above for word "news" this prevents for me to request through got. can you remove the spec check? if URL is wrong then that is up to the dev. if anything for validation it should have a separate lib or function. |
They way you encode it is wrong. I just checked and it's possible to encode it properly.
No. Got is a spec-compliant client. |
What about the tests?
got/test/arguments.ts
Lines 38 to 45 in d0cd709
https://url.spec.whatwg.org/#percent-encoded-bytes