You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Angular service worker application throws following error
Failed to HTTP in live url load resource : the server responded with a status of 504 (Gateway Timeout)
Expected behavior
It should not throw any exceptions
Minimal reproduction of the problem with instructions
download application -> install npm -> build( ng build --prod) -> upload to any live server.
NOTE: in localhost, it works fine
Environment
Angular version: 5.2.5
Browser:
- [ ] Chrome (desktop) version 65.0.3325.181
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: 8.9.3
- Platform: Linux
Can you please share here, how you are using angular http service. It seems like you are facing issue due to some missing server-side configurations, something which is not related to angular.
@jainanuj0812 follow my uploaded application. In that application, I just set demo images three is in HTTPS and same three in HTTP when you set a refresh page https images are load but not HTTP images. You can check in console and Network tab of developer option.
This seems to be caused by the fact that, while "passive mixed content" (like images) only produces a warning without a ServiceWorker, fetching it via a ServiceWorker results in an error. This applies to ServiceWorkers in general and is not specific to Angular's implementation.
The link provided by @akoserwal above has more details on mixed content.
As fas as I understand, the fact that fetching from within the ServiceWorker behaves differently than fetching without a ServiceWorker is a limitation of ServiceWorkers (see relevant discussions here, here, and here).
One option for @angular/service-worker would be to choose not to handle this type of requests, but given that mixed content is insecure for users anyway, I would not be too keen on supporting it in @angular/service-worker 😈
While fixing #20404 we can make sure that it is possible to specify URL patterns that won't be handled by the ServiceWorker, which would provide a work-around for your usecase (i.e. you could config the SW to ignore http: URLs and let the browser handle them).
So, the only fix/work-around I can think of is ignoring http: requests if the SW's scope is on https:. This can be checked synchronously and will avoid handling mixed content in the SW, which is currently not possible anyway.
@akilmakda, I fixed my previous comment. I meant that #20404 cannot fix your usecase.
As mentioned in #23012 (comment), one fix/work-around I can think of would be to not handle mixed content from the service worker (but that is a change that needs to be made to the SW; it is not something you can do yourself).
@gkalpak It seems like this issue is faced by many of user but got stuck in approval process. I am also waiting for this fix for almost 6+ months.
Kindly provide some tentative dates.
Not sure what you mean @shabbir-dhangot. You don't have to do anything. This was a change in @angular/service-worker internals (it now ignores mixed content requests), you don't have to change anything in your app.
angular-automatic-lock-bot commented on Oct 6, 2019
Activity
jainanuj0812 commentedon Mar 27, 2018
Can you please share here, how you are using angular http service. It seems like you are facing issue due to some missing server-side configurations, something which is not related to angular.
akilmakda commentedon Mar 27, 2018
@jainanuj0812 follow my uploaded application. In that application, I just set demo images three is in HTTPS and same three in HTTP when you set a refresh page https images are load but not HTTP images. You can check in console and Network tab of developer option.
i set application in this server : https://ghostly-baud.000webhostapp.com/
akoserwal commentedon Mar 27, 2018
@akilmakda: please have a look at
jainanuj0812 commentedon Mar 27, 2018
@akilmakda, You can't make a request to HTTP from the HTTPS based origin.
https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
gkalpak commentedon Mar 27, 2018
This seems to be caused by the fact that, while "passive mixed content" (like images) only produces a warning without a ServiceWorker, fetching it via a ServiceWorker results in an error. This applies to ServiceWorkers in general and is not specific to Angular's implementation.
The link provided by @akoserwal above has more details on mixed content.
As fas as I understand, the fact that fetching from within the ServiceWorker behaves differently than fetching without a ServiceWorker is a limitation of ServiceWorkers (see relevant discussions here, here, and here).
One option for
@angular/service-workerwould be to choose not to handle this type of requests, but given that mixed content is insecure for users anyway, I would not be too keen on supporting it in@angular/service-worker😈While fixing #20404 we can make sure that it is possible to specify URL patterns that won't be handled by the ServiceWorker, which would provide a work-around for your usecase (i.e. you could config the SW to ignore
http:URLs and let the browser handle them).WDYT, @alxhub?
gkalpak commentedon Mar 27, 2018
It turns out that the fix for #20404
cancannot provide a work-around for this issue.gkalpak commentedon Mar 28, 2018
So, the only fix/work-around I can think of is ignoring
http:requests if the SW's scope is onhttps:. This can be checked synchronously and will avoid handling mixed content in the SW, which is currently not possible anyway.akilmakda commentedon Apr 2, 2018
@gkalpak 'ignoredUrlPatterns' not work for HTTP response. can you give any e.g how to ignore HTTP response.
or any other way to ignore HTTP API response.
gkalpak commentedon Apr 2, 2018
@akilmakda, I fixed my previous comment. I meant that #20404 cannot fix your usecase.
As mentioned in #23012 (comment), one fix/work-around I can think of would be to not handle mixed content from the service worker (but that is a change that needs to be made to the SW; it is not something you can do yourself).
19 remaining items
Krishna-Agrawal commentedon Jan 18, 2019
@gkalpak any update on this?
akilmakda commentedon Jan 29, 2019
@gkalpak any update?
gkalpak commentedon Jan 29, 2019
I have a fix in #25994, but it is pending approval...
eliraneliassy commentedon Feb 27, 2019
@gkalpak +1 here
shabbir-dhangot commentedon Mar 1, 2019
@gkalpak It seems like this issue is faced by many of user but got stuck in approval process. I am also waiting for this fix for almost 6+ months.
Kindly provide some tentative dates.
gkalpak commentedon Mar 4, 2019
@shabbir-dhangot, hopefully this week 🎉 (based on #25994 (comment))
fix(service-worker): ignore passive mixed content requests
fix(service-worker): ignore passive mixed content requests (#25994)
fix(deps): update angular monorepo to v7.2.8 (#97)
shabbir-dhangot commentedon Sep 5, 2019
@gkalpak can you share document link how we can start using this?
gkalpak commentedon Sep 5, 2019
Not sure what you mean @shabbir-dhangot. You don't have to do anything. This was a change in
@angular/service-workerinternals (it now ignores mixed content requests), you don't have to change anything in your app.angular-automatic-lock-bot commentedon Oct 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.