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

ERR_INVALID_PROTOCOL for http files in version 5.0.1 #210

Closed
fredrikhr opened this issue Feb 28, 2022 · 8 comments
Closed

ERR_INVALID_PROTOCOL for http files in version 5.0.1 #210

fredrikhr opened this issue Feb 28, 2022 · 8 comments

Comments

@fredrikhr
Copy link
Contributor

HTTP File:

###
# @name PowerAppsBearerChallenge
@PowerAppsCommonApiEndpoint = https://api.powerapps.com
@PowerAppsApiVersionLatest = 2021-02-01
GET {{PowerAppsCommonApiEndpoint}}
  /providers/microsoft.PowerApps
  /environments
  ?api-version={{PowerAppsApiVersionLatest}}
Authorization: Bearer

When executing using node:

$ npx [email protected] test.http --all
Please use request.options[...] instead of request[...] for setting Got Options (protocol). Support will be removed
https://api.powerapps.com/providers/microsoft.PowerApps/environments?api-version=2021-02-01 {        
  protocol: 'HTTP',
  url: 'https://api.powerapps.com/providers/microsoft.PowerApps/environments?api-version=2021-02-01',
  method: 'GET',
  options: {
    http2: undefined,
    cookieJar: CookieJar {
      rejectPublicSuffixes: true,
      enableLooseMode: false,
      allowSpecialUseDomain: false,
      store: { idx: {} },
      prefixSecurity: 'silent',
      _cloneSync: [Function (anonymous)],
      _importCookiesSync: [Function (anonymous)],
      getCookiesSync: [Function (anonymous)],
      getCookieStringSync: [Function (anonymous)],
      getSetCookieStringsSync: [Function (anonymous)],
      removeAllCookiesSync: [Function (anonymous)],
      setCookieSync: [Function (anonymous)],
      serializeSync: [Function (anonymous)]
    }
  },
  headers: { Authorization: 'Bearer' },
  proxy: undefined
} RequestError: Protocol "HTTP" not supported. Expected "http:"
    at Request._makeRequest (C:\path\to\test_dir\node_modules\got\dist\source\core\index.js:1183:19)
    at new NodeError (node:internal/errors:371:5)
    at new ClientRequest (node:_http_client:158:11)
    at request (node:http:96:10)
    at Request._makeRequest (C:\path\to\test_dir\node_modules\got\dist\source\core\index.js:1130:43)
    at async C:\path\to\test_dir\node_modules\got\dist\source\core\index.js:334:17 {
  code: 'ERR_INVALID_PROTOCOL',
  timings: undefined
}
RequestError: Protocol "HTTP" not supported. Expected "http:"
    at Request._makeRequest (C:\path\to\test_dir\node_modules\got\dist\source\core\index.js:1183:19)
    at new NodeError (node:internal/errors:371:5)
    at new ClientRequest (node:_http_client:158:11)
    at request (node:http:96:10)
    at Request._makeRequest (C:\path\to\test_dir\node_modules\got\dist\source\core\index.js:1130:43)
    at async C:\path\to\test_dir\node_modules\got\dist\source\core\index.js:334:17 {
  code: 'ERR_INVALID_PROTOCOL',
  timings: undefined
}
AnWeber added a commit that referenced this issue Feb 28, 2022
@fredrikhr
Copy link
Contributor Author

I noticed that if I replace all the variables with constants, the same error occurs:

###
# @name PowerAppsBearerChallenge
GET https://api.powerapps.com
  /providers/microsoft.PowerApps
  /environments
  ?api-version=2021-02-01
Authorization: Bearer

@AnWeber
Copy link
Owner

AnWeber commented Feb 28, 2022

Did a great job. I wanted to optimize for me only briefly the display for RabbitMQ and thereby immediately made the whole project broken. Thanks for the hint.

@AnWeber
Copy link
Owner

AnWeber commented Feb 28, 2022

This not well thought out commit was the cause: 86c5932. Github Action is publishing a v5.0.2

@fredrikhr
Copy link
Contributor Author

Hmm still not working for v5.0.2:

$ npx [email protected] test.http --all
Please use request.options[...] instead of request[...] for setting Got Options (protocol). Support will be removed
https://api.powerapps.com/providers/microsoft.PowerApps/environments?api-version=2021-02-01 {
  protocol: 'HTTP',
  url: 'https://api.powerapps.com/providers/microsoft.PowerApps/environments?api-version=2021-02-01',
  method: 'GET',
  options: {
    http2: undefined,
    cookieJar: CookieJar {
      rejectPublicSuffixes: true,
      enableLooseMode: false,
      allowSpecialUseDomain: false,
      store: { idx: {} },
      prefixSecurity: 'silent',
      _cloneSync: [Function (anonymous)],
      _importCookiesSync: [Function (anonymous)],
      getCookiesSync: [Function (anonymous)],
      getCookieStringSync: [Function (anonymous)],
      getSetCookieStringsSync: [Function (anonymous)],
      removeAllCookiesSync: [Function (anonymous)],
      setCookieSync: [Function (anonymous)],
      serializeSync: [Function (anonymous)]
    }
  },
  headers: { Authorization: 'Bearer' },
  proxy: undefined
} RequestError: Protocol "HTTP" not supported. Expected "http:"
    at Request._makeRequest (/mnt/c/Users/sr341/OneDrive - Troms Kraft/Dokumenter/httpyac/node_modules/got/dist/source/core/index.js:1183:19)
    at new NodeError (node:internal/errors:371:5)
    at new ClientRequest (node:_http_client:158:11)
    at request (node:http:96:10)
    at Request._makeRequest (/mnt/c/Users/sr341/OneDrive - Troms Kraft/Dokumenter/httpyac/node_modules/got/dist/source/core/index.js:1130:43)
    at async /mnt/c/Users/sr341/OneDrive - Troms Kraft/Dokumenter/httpyac/node_modules/got/dist/source/core/index.js:334:17 {
  code: 'ERR_INVALID_PROTOCOL',
  timings: undefined
}
RequestError: Protocol "HTTP" not supported. Expected "http:"
    at Request._makeRequest (/mnt/c/Users/sr341/OneDrive - Troms Kraft/Dokumenter/httpyac/node_modules/got/dist/source/core/index.js:1183:19)
    at new NodeError (node:internal/errors:371:5)
    at new ClientRequest (node:_http_client:158:11)
    at request (node:http:96:10)
    at Request._makeRequest (/mnt/c/Users/sr341/OneDrive - Troms Kraft/Dokumenter/httpyac/node_modules/got/dist/source/core/index.js:1130:43)
    at async /mnt/c/Users/sr341/OneDrive - Troms Kraft/Dokumenter/httpyac/node_modules/got/dist/source/core/index.js:334:17 {
  code: 'ERR_INVALID_PROTOCOL',
  timings: undefined
}

@AnWeber
Copy link
Owner

AnWeber commented Feb 28, 2022

But I don't understand right now, a "simple" request works for me. Give me a moment, then I simply revert the commit from this morning.

@fredrikhr
Copy link
Contributor Author

Ah, I hadn't yet updated node_modules, I had just run npx [email protected] and thought that would just work

@AnWeber
Copy link
Owner

AnWeber commented Feb 28, 2022

I have now removed the protocol property from http requests anyway. I found another error regarding OAuth2 configuration, I have corrected it now.

@fredrikhr
Copy link
Contributor Author

I can confirm that everything now seems to work again.

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