Skip to content

Request cannot be constructed from a URL that includes credentials #678

Closed

Description

@roddone

Hi,

I'm using isomorphic-git in the browser and the upgrade from 0.43.1 to 0.51.0 broke our connexion to azure devops git with the following error :
TypeError: Failed to execute 'fetch' on 'Window': Request cannot be constructed from a URL that includes credentials
The url is formatted like this : https://#User#@dev.azure.com/#Organization#/#Project#/_git/#Repository#
(I can't give the exact url for privacy)

Maybe caused by #605 ?

Activity

  1. billiegoose commented on Jan 8, 2019

    @billiegoose
    Member

    Wait a minute... can Azure DevOps git can be fetched in the browser without using a CORS proxy?

  2. roddone commented on Jan 8, 2019

    @roddone
    Author

    Yes, it seems to be able to fetch without cors proxy 😉.

    Thanks for the quick fix, I will test it asap and close this if it corrects the issue.

  3. billiegoose commented on Jan 8, 2019

    @billiegoose
    Member

    I'll go ahead and merge the fix I guess!

  4. billiegoose commented on Jan 8, 2019

    @billiegoose
    Member

    Oh haha, merging the PR closes the issue. Well if after you test it, it doesn't work, it's easy to reopen this issue! 😄 The bot will leave a comment here in a bit once it's published.

    And that is SUPER AWESOME that Azure DevOps supports CORS headers! I will have to test that out myself; that is news to me! I'll want to add that to the README! 🎉

  5. isomorphic-git-bot commented on Jan 8, 2019

    @isomorphic-git-bot
    Member

    🎉 This issue has been resolved in version 0.51.1 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  6. billiegoose commented on Jan 8, 2019

    @billiegoose
    Member

    @roddone It looks like isomorphic-git needs the noGitSuffix: true param in order to clone from Azure. (Are you using that out of curiosity? I really want to fix that behavior for the 1.0 release.)

    Also, (I just thought of this) the code can't handle "mixing" specifying the username via the URL and the password via a parameter. E.g.

    git.clone({ ..., password: 'TOKEN', url: 'https://username@dev.azure.com/...' })

    throws an error saying the username is missing. I don't think that worked in 0.43.1, let me know if we need to cover that case. We probably don't... it works if you add a username param. The main thing is it no longer throws an error, since we strip out username:password from URLs now before handing them to window.fetch.

  7. roddone commented on Jan 8, 2019

    @roddone
    Author

    @wmhilton yes we use the noGitSuffix: true and we specify both 'password' and 'username' parameters.
    I don't think there is another way to do make it work with azure devops but if you find one, please share the tip !

    I'm away from office until tomorrow, so I will probably be able to test your fix tomorrow ;)

  8. roddone commented on Jan 9, 2019

    @roddone
    Author

    I confirm your fix did the job, thanks !

  9. pdittaro commented on Mar 6, 2019

    @pdittaro

    Just as a headsup @roddone , you can authenticate to Azure DevOps using PATs as well if you use the username and token params. The username param just has to be set to the organization name. Still need the noGitSuffix: true as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions