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

Misleading error message when https:// is not specified in target URL #69

Open
davidferlay opened this issue Aug 22, 2022 · 1 comment

Comments

@davidferlay
Copy link

Steps to reproduce

docker run -it --user root:root --rm --init -v `pwd`:`pwd` -w `pwd` skilldlabs/php:74-fpm /bin/ash
composer global require elendev/composer-push --no-interaction
composer global config --no-plugins allow-plugins.elendev/composer-push true

Observed

composer push --url=repositories.XXX.com/repository/XXXX/ --username=XXXX --password="XXXX" 1.0.22

Returns error:

Pushing archive to URL: repositories.XXX.com/repository/XXX/packages/upload/XXX/formatter_video_popup/1.0.22...
  100 [============================]

                                                                                                                                                                                              
  [GuzzleHttp\Exception\RequestException]                                                                                                                                                     
  cURL error 18: transfer closed with outstanding read data remaining (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://repositories.XXX.com/repository/XXXX/packages/upload/XXXX/formatter_video_popup/1.0.22                                                                                                                            
                                                                                                                                                                                              

push [--name NAME] [--url URL] [--type TYPE] [--repository REPOSITORY] [--username USERNAME] [--password PASSWORD] [-i|--ignore [IGNORE]] [--ignore-dirs [IGNORE-DIRS]] [--ignore-by-git-attributes] [--ignore-by-composer] [--src-type SRC-TYPE] [--src-url SRC-URL] [--src-ref SRC-REF] [--keep-vendor] [--keep-dot-files] [--ssl-verify [SSL-VERIFY]] [--access-token [ACCESS-TOKEN]] [--] [<version>]

Whereas

composer push --url=https://repositories.XXX.com/repository/XXXX/ --username=XXXX --password="XXXX" 1.0.22

Returns success:

Pushing archive to URL: https://repositories.XXX.com/repository/XXXpackages/upload/XXX/formatter_video_popup/1.0.22...
  100 [============================]
Archive correctly pushed to the Nexus server

Expected

  • If composer push command requires full URL (protocol + URI), command should fail by throwing an appropriate error message instead of displaying cURL error message
@andypost
Copy link
Contributor

basically it could use filter_var() to make sure URL is valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants