Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway: Replace Target Node Data when Exists on POST #4086

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

te0d
Copy link
Contributor

@te0d te0d commented Jul 24, 2017

Previously, if the specified path of a POST request
existed, the newly generated DAG would have a root
of the specified path instead of only modifying the
data of the existing DAG at that path. These changes
modify behavior so that the entire tree structure
of the initially specified root CID is maintained,
and the only change is the Data at the specified path.

License: MIT
Signed-off-by: Tom O'Donnell todonnell@gmail.com

@te0d
Copy link
Contributor Author

te0d commented Jul 24, 2017

Fixes: #3923

@te0d te0d closed this Jul 24, 2017
@te0d te0d reopened this Jul 24, 2017
@te0d te0d closed this Jul 24, 2017
@te0d te0d reopened this Aug 4, 2017
@te0d te0d force-pushed the fix/gateway/post-existing branch from d6e7d9d to 205ebd8 Compare August 4, 2017 19:12
@whyrusleeping whyrusleeping requested a review from a user September 1, 2017 22:59
@whyrusleeping
Copy link
Member

@Kubuxu @diasdavid @lgierth want to review this? I dont have much insight into the gateway code

@ghost
Copy link

ghost commented Sep 1, 2017

Hey @te0d, thanks for bearing with us! The proposal makes sense -- we shouldn't have allowed POST to existing nodes in the first place, but it's already there so the links-preserving mode you propose is the best thing to do.

I'll set a few hours aside for reviewing the code over the weekend -- could you rebase it on master in the meantime? Thanks!

Previously, if the specified path of a POST request
existed, the newly generated DAG would have a root
of the specified path instead of only modifying the
data of the existing DAG at that path. These changes
modify behavior so that the entire tree structure
of the initially specified root CID is maintained,
and the only change is the Data at the specified path.

License: MIT
Signed-off-by: Tom O'Donnell <todonnell@gmail.com>
The previous commit would fail when an empty directory was
specified. This commit checks if the empty directory is
specified, and will return an empty directory as it did
previously. Also added a test case which verifies that a
PUT to an existing file for a given DAG will overwrite
its contents and return the correct new DAG.

License: MIT
Signed-off-by: Tom O'Donnell <todonnel91@gmail.com>
@te0d
Copy link
Contributor Author

te0d commented Sep 5, 2017

@lgierth I believe I've rebased it on master.

@lanzafame lanzafame added the topic/gateway Topic gateway label Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/gateway Topic gateway
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants