-
Notifications
You must be signed in to change notification settings - Fork 412
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
Adding Support for chrome extension 'scheme' #2465
Conversation
@@ -3039,8 +3039,8 @@ object Header { | |||
if (value == "null") Right(Null) | |||
else | |||
URL.decode(value) match { | |||
case Left(_) => Left("Invalid Origin header") | |||
case Right(url) if url.host.isEmpty || url.scheme.isEmpty => Left("Invalid Origin header") | |||
case Left(_) => Left(s"Invalid Origin header '$value'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better error message for clarity
case 3 => Scheme.WSS | ||
case 2 => Scheme.WS | ||
case _ => null | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided for clarity over "speed"
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2465 +/- ##
=======================================
Coverage 64.76% 64.76%
=======================================
Files 136 136
Lines 7197 7201 +4
Branches 1296 1276 -20
=======================================
+ Hits 4661 4664 +3
- Misses 2536 2537 +1
☔ View full report in Codecov by Sentry. |
c6c11f9
to
c7aabbb
Compare
case Scheme.HTTPS => "https" | ||
case Scheme.WS => "ws" | ||
case Scheme.WSS => "wss" | ||
case Scheme.ChromeExtension => "chrome-extension" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the right solution also, but, as it is today, zio http fails to accept requests from chrome extensions
I think #2489 confirms my hinch. We should have a custom type that stores non predefined schema values. |
I'm just concerned about efficiency. |
What kind of efficiency are we talking about?
So, where do you see an issue? |
I agree to have a |
@vigoo there is #2490 which is already further in development. |
ZIO Http fails to handle requests from chrome extensions, when the origin header is chrome-extension://EXTENSION_ID.