mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:28:19 -05:00
fix #24849
This commit is contained in:
@@ -17,7 +17,7 @@ function encodeURIComponent2(str: string): string {
|
||||
}
|
||||
|
||||
function encodeNoop(str: string): string {
|
||||
return str;
|
||||
return str.replace(/[#?]/, _encode);
|
||||
}
|
||||
|
||||
|
||||
@@ -364,10 +364,10 @@ export default class URI {
|
||||
while (true) {
|
||||
let idx = path.indexOf(URI._slash, lastIdx);
|
||||
if (idx === -1) {
|
||||
parts.push(encoder(path.substring(lastIdx)).replace(/[#?]/, _encode));
|
||||
parts.push(encoder(path.substring(lastIdx)));
|
||||
break;
|
||||
}
|
||||
parts.push(encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode), URI._slash);
|
||||
parts.push(encoder(path.substring(lastIdx, idx)), URI._slash);
|
||||
lastIdx = idx + 1;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -399,6 +399,10 @@ suite('URI', () => {
|
||||
uri2 = URI.parse(uri.toString());
|
||||
assert.equal(uri2.query, 'LinkId=518008&foö&ké¥=üü');
|
||||
assert.equal(uri2.query, uri.query);
|
||||
|
||||
// #24849
|
||||
uri = URI.parse('https://twitter.com/search?src=typd&q=%23tag');
|
||||
assert.equal(uri.toString(true), 'https://twitter.com/search?src=typd&q=%23tag');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user