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

Headers missing #1

Open
nunodonato opened this issue Feb 11, 2021 · 3 comments
Open

Headers missing #1

nunodonato opened this issue Feb 11, 2021 · 3 comments

Comments

@nunodonato
Copy link

simplexml_load_file will fail while fetching contents from certain websites due to missing headers. They should be set up in a proper context and then passed to simplexml_load_file
can I make a pull request for this?

@mdobydullah
Copy link
Owner

Thank you. @nunodonato. Yeah, sure.

@nunodonato
Copy link
Author

nunodonato commented Feb 12, 2021

well the problem is that my solution is only for Laravel, because it uses
use Illuminate\Support\Facades\Http;

basically I'm doing
$content = Http::get($this->url);
$feed_data = simplexml_load_string($content, 'SimpleXMLElement', LIBXML_NOCDATA);

so I let the Http request handle the headers, and then just load the contents via simplexml_load_string

But I think this will break whoever is using your package without laravel...

@mdobydullah
Copy link
Owner

mdobydullah commented Feb 13, 2021

Hi, @nunodonato.

I see. I'll take a look and apply the solution for all applications. You can give a feed link to test.

Thank you.

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