I think the only way to access s3 documents semi-directly within a browser based http request is via cloud front. In cloud front the necessary headers can be added to response to allow cross origin requests.
On Wed, Nov 11, 2020 at 7:24 AM NANA DARKO <[email protected]> wrote: > Angular is not a backend framework. You should be using something like > nodejs, python or c# for the backend/api. So depending on your programming > language for the api then you find the fix indicated above. > > On Wed, Nov 11, 2020, 12:19 Tarun Surana <[email protected]> > wrote: > >> can you suggest me what code should be write in angular for api? >> >> On Wednesday, November 11, 2020 at 10:13:35 AM UTC+5:30 >> [email protected] wrote: >> >>> CORS error is not an issue with angular. You need to fix it on the api. >>> Accept headers on the api. You should also allow calls from http localhost >>> (whitelist). This can slightly vary depending on the language you're using >>> for the api. >>> All the best. >>> >>> On Tue, Nov 10, 2020, 22:55 Johannes Hillert <[email protected]> >>> wrote: >>> >>>> Hey, >>>> >>>> it is supposed to do that. >>>> >>>> See: >>>> >>>> - Cross-Origin Resource Sharing (CORS) >>>> <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS> >>>> - Same-origin policy >>>> >>>> <https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy> >>>> >>>> Does the problem persist if you access 'https://pro-api...' from an >>>> origin with HTTPS scheme? >>>> >>>> This describes how to serve the local app over HTTPS: Get angular-cli >>>> to ng serve over HTTPS <https://stackoverflow.com/a/44055209/4076983> >>>> >>>> Settings this might also help: Access-Control-Allow-Origin >>>> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin> >>>> >>>> Kind regards, >>>> Johannes >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Angular and AngularJS discussion" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/angular/c4c7de9b-1b70-4fe4-bc25-c47e9062043an%40googlegroups.com >>>> <https://groups.google.com/d/msgid/angular/c4c7de9b-1b70-4fe4-bc25-c47e9062043an%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Angular and AngularJS discussion" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/angular/b148ead9-1de1-4d58-9a77-f09369349969n%40googlegroups.com >> <https://groups.google.com/d/msgid/angular/b148ead9-1de1-4d58-9a77-f09369349969n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Angular and AngularJS discussion" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/angular/CANd8XNvpdarTP0XibtzvgzV1hYrjx5Ytp2sk7e%3DrxHe9DXUv7Q%40mail.gmail.com > <https://groups.google.com/d/msgid/angular/CANd8XNvpdarTP0XibtzvgzV1hYrjx5Ytp2sk7e%3DrxHe9DXUv7Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/CAC4BQD45hAScL9X4_%2BRLxB5b1BBn3ctVf71CcbpRF3i--qJyOA%40mail.gmail.com.
