Fix a cryptic error you get if you use the wrong URL for your GitHub Enterprise Server instance. #49
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.
One user of the tool encountered this cryptic error:
This is error is actually caused by the
--destination-url
being specified as an HTTP URL instead of an HTTPS URL. The HTTP URL 301 redirects to the HTTPS URL and the client dutifully follows those redirects which is all well-and-good until we try and make a non-GET request, at which point it it gets converted to a GET request and receives a 404 response (arguably a 405 would make more sense).Ideally GitHub Enterprise Server should be returning a 308 redirect which disallows changing the method after the redirect but my understanding is that this is not supported by all clients and probably difficult to change. Instead the tool can handle this case by updating the URL right at the start if it detects the root of the API redirects.