microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.94k stars 29.52k forks source link

[VS Code Marketplace] Repeated downloads are also counted #111818

Closed writeawesomecode closed 3 years ago

writeawesomecode commented 4 years ago

Steps to Reproduce:

I found that vs code marketplace counts the number of repeated downloads. The following code works and it is amazing. I just run some code, then downloads increased by 6000, it's so easy.

https://github.com/Wscats/compile-hero/commit/7165a7700487d5ad60184266e696059ceafef697

setInterval(() => {
    i++;
    (function (i) {
        https.get('https://wscats.gallery.vsassets.io/_apis/public/gallery/publisher/Wscats/extension/vue/1.0.7/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage?redirect=true&install=true', {
            headers: {
                // ":method": "GET",    
                // ":authority": "wscats.gallery.vsassets.io",  
                // ":scheme": "https",  
                // ":path": "/_apis/public/gallery/publisher/Wscats/extension/qf/6.7.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage?redirect=true&install=true", 
                "accept": "*/*",
                "accept-encoding": "gzip, deflate, br",
                "accept-language": "zh-CN",
                "cookie": "EnableExternalSearchForVSCode=true",
                "user-agent": "VSCode 1.39.2",
                "x-market-client-id": "VSCode 1.39.2",
                "x-market-user-id": "f2500034-c981-4f54-bcdb-45bbf63994b3"
            }
        }, function (res) {
            console.log(i);
            // console.log(res) 
        }).on('error', function (e) {
            console.error("\u51FA\u73B0\u9519\u8BEF: " + e.message);
        });
    })(i);
}, 6000);
joaomoreno commented 3 years ago

We have notified the Marketplace of this. They will investigate, thanks for raising awareness.

prashantvc commented 3 years ago

Thanks a lot for the report. This sounds like a serious issue; we are looking into the issue.

munishgoyal1 commented 3 years ago

Ignore previous linked issue #630

the right issue - microsoft/vsmarketplace#625