[PLAT-5608]: Automatically add the correct suffix to endpoint #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
Only accepting the full/absolute URL meant that On-Premise needed to know unecessary detail about the different paths on the upload server, and also meant some commands were unnecessarily repetitive:
Design
Based on the kind of source map being uploaded (which we know becuase there is a separate command/library for each) we can predict what the path of the URL is: either
/sourcemap
¹ or/react-native-source-map
¹ the path
/source-map
exists (which is correctly named) but for now we use/sourcemap
– it has existed for longer so supports older On-Premise versions.Changeset
--endpoint
provided includes a path longer than/
, it will use that verbatim)Testing
Updated unit tests.