nosinovacao / name-sdk

A dependencies management library designed to expose and access dependencies information.
BSD 3-Clause "New" or "Revised" License
14 stars 4 forks source link

NAME should retry to fetch the manifest when the serialization fails #8

Closed Symbianx closed 7 years ago

Symbianx commented 7 years ago

In some cases, when fetching a dependency manifest, said dependency may return a 200 status code even if NAME is not listening in that endpoint. Currently NAME fails to deserialize the manifest from the response and fails for that dependency.

Changes:

Before deserializing the manifest, NAME should look at the returned X-NAME-Manifest-Endpoint header and check if the requested endpoint was the same as the header, if true, it should deserialize the manifest. Otherwise it should abort and try to get the manifest from the correct endpoint.