-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
base: master
Are you sure you want to change the base?
Conversation
Fixes: #3923 |
d6e7d9d
to
205ebd8
Compare
@Kubuxu @diasdavid @lgierth want to review this? I dont have much insight into the gateway code |
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>
205ebd8
to
c0501dd
Compare
@lgierth I believe I've rebased it on master. |
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