codius / old-codius-cli

Codius Client Command Line Interface (CLI)
https://codius.org
Apache License 2.0
110 stars 13 forks source link

Issue with absolute URL #46

Closed mmaton closed 6 years ago

mmaton commented 6 years ago

FAIL: codius upload create-react-app-manifest.json -h codius.ripple-ledger.com

PASS:

codius upload create-react-app-manifest.json -h https://codius.ripple-ledger.com 
Successfully Uploaded Pods to:
[ { url:
     'https://lg6gjhhh2b3if2tzpbms6cr3hdmh7dixa2v4an6pz4tdxdmqtjpa.codius.ripple-ledger.com/',
    manifestHash: 'lg6gjhhh2b3if2tzpbms6cr3hdmh7dixa2v4an6pz4tdxdmqtjpa',
    host: 'https://codius.ripple-ledger.com',
    expiry: '2018-06-24T16:08:40.783Z',
    expirationDate: '06-24-2018 5:08:40 +0100',
    expires: 'in 9 minutes',
    pricePaid: '229' } ]

VERBOSE ISSUE:

clientAddress=g.scylla.client.flMZea1ZqFtkeoSxtyK7GtHfcF4vM4Z22qMV8wS2lGs.local._hKuRld7Knh6BtX0-5Oq9rl2ygZJ2QGs97jFCKKXz6E assetScale=6 assetCode=XRP +0ms
  codius-cli:price Total Amount in units: 22821 +47ms
  codius-cli:uploadHandler Max price in units 22821 +0ms
  ilp-fetch attempting http request. url=codius2.justmoon.com/pods?duration=600 opts= { headers:
   { Accept: 'application/codius-v1+json',
     'Content-Type': 'application/json' },
  method: 'OPTIONS',
  body:
   '{"manifest":{"name":"my-codius-create-react-app","version":"1.0.0","machine":"small","port":"3000","containers":[{"id":"app","image":"androswong418/example-pod-1@sha256:8933bced1637e7d3b08c4aa50b96a45aef0b63f504f595bb890f57253af68b11"}]}}' } +0ms
Fetching price quote from host codius2.justmoon.com failed, please try again
TypeError: Only absolute URLs are supported
    at getNodeRequestOptions (/usr/lib/node_modules/codius/node_modules/node-fetch/lib/index.js:1284:9)
    at /usr/lib/node_modules/codius/node_modules/node-fetch/lib/index.js:1370:19
    at new Promise (<anonymous>)
    at fetch (/usr/lib/node_modules/codius/node_modules/node-fetch/lib/index.js:1367:9)
    at ilpFetch (/usr/lib/node_modules/codius/node_modules/ilp-fetch/index.js:29:26)
    at uploadToHosts (/usr/lib/node_modules/codius/src/handlers/upload.js:49:33)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  codius-cli:uploadHandler Error: Fetching price quote from host codius2.justmoon.com failed
  codius-cli:uploadHandler     at uploadToHosts (/usr/lib/node_modules/codius/src/handlers/upload.js:64:13)
  codius-cli:uploadHandler     at process._tickCallback (internal/process/next_tick.js:68:7) +5ms

WILL FIX TOMORROW

traviscrist commented 6 years ago

Thanks for bringing up the issue with absolute urls. Ill look into adding https:// to any urls which do not include https://

mmaton commented 6 years ago

Thanks!