Skip to content

Client does not handle an empty transfer response #5

Description

@rickardgranberg

I've found a small issue using download with the client when the server does not return a transfer property in the response, which is allowed according to the API specification:

Successful responses include the following properties:

* transfer - String identifier of the transfer adapter that the server prefers. This MUST be one of the given transfer identifiers from the request. Servers can assume the basic transfer adapter if none were given. The Git LFS client will use the basic transfer adapter if the transfer property is omitted.

I've traced the problem to here:

adapter = self.TRANSFER_ADAPTERS[response['transfer']]()

It's a very easy fix, just change it like so:

adapter = self.TRANSFER_ADAPTERS[response['transfer'] if "transfer" in response else "basic"]()

I can provide a PR if you wish.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions