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

[Endpoint] TypeError [ERR_INVALID_URL]: Invalid URL: http:/ #3780

Closed
sentry-io bot opened this issue Jul 25, 2019 · 7 comments · Fixed by #4067
Closed

[Endpoint] TypeError [ERR_INVALID_URL]: Invalid URL: http:/ #3780

sentry-io bot opened this issue Jul 25, 2019 · 7 comments · Fixed by #4067
Labels
bug Bugs in badges and the frontend sentry Bugs found using Sentry service-badge Accepted and actionable changes, features, and bugs

Comments

@sentry-io
Copy link

sentry-io bot commented Jul 25, 2019

Sentry Issue: SHIELDS-2Z

TypeError [ERR_INVALID_URL]: Invalid URL: http:/
  File "/home/m/shields/services/endpoint/endpoint.service.js", line 70, in Endpoint.handle
    const { protocol, hostname } = new URL(url)
  File "/home/m/shields/core/base-service/base.js", line 375, in Function.invoke
    serviceData = await serviceInstance.handle(
  File "/home/m/shields/core/base-service/base.js", line 423, in Object.handler
    const serviceData = await this.invoke(
  File "/home/m/shields/core/base-service/legacy-request-handler.js", line 243, in null.<anonymous>
    const result = handlerOptions.handler(
...
(5 additional frame(s) were not displayed)
@paulmelnikow paulmelnikow added bug Bugs in badges and the frontend service-badge Accepted and actionable changes, features, and bugs sentry Bugs found using Sentry labels Jul 25, 2019
@paulmelnikow
Copy link
Member

This is either a bug or unexpected behavior in Joi. I opened hapijs/joi#1994.

@paulmelnikow
Copy link
Member

Failing test:

t.create('Invalid URL')
  .get('.json?url=https:/')
  .expectBadge({ label: 'custom badge', message: 'invalid query parameter: url' })

@calebcartwright
Copy link
Member

It's a bummer that we'll have to finish the v16 upgrade since the fix in joi wasn't ported into v15.x

@calebcartwright
Copy link
Member

This should be resolved now that #4031 is complete, right?

@paulmelnikow
Copy link
Member

@calebcartwright
Copy link
Member

Want to add the test?

sure, what did you have in mind? a service test with an invalid query param?

@paulmelnikow
Copy link
Member

Yea, I meant like the one I pasted in above, which seems to be the same direction you went 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend sentry Bugs found using Sentry service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants