meilisearch / scrapix

MIT License
21 stars 9 forks source link

add configuration option for additional request headers #96

Closed dardanbujupaj closed 5 months ago

dardanbujupaj commented 5 months ago

Pull Request

Related issue

none

What does this PR do?

We're using scrapix to index our documentation. Some parts of the documentation are protected, so we need a way to send some authentication information with the crawler requests. This PR adds a new configuration property additional_request_headers which are applied to each request in a pre navigation hook. This way we're able to either send an Authorization header (basic, bearer etc.) or a custom auth header (e.g. x-access-key), so it should be quite flexible for any usecase.

dardanbujupaj commented 5 months ago

PS: we're running this from our fork, but I thought the changes might as well be relevant to this repo. feel free to merge or close the PR as you see fit 🙃

brunoocasali commented 5 months ago

Hey @dardanbujupaj, thanks a lot for your contribution!!

Can you include some examples of how you can use this feature in the README?

dardanbujupaj commented 5 months ago

Can you include some examples of how you can use this feature in the README?

@brunoocasali Sure, I'll add something this evening.

dardanbujupaj commented 5 months ago

@brunoocasali added the configuration property description to the readme with a short example.

Let me know if there's anything else to improve!

meili-bors[bot] commented 5 months ago

Configuration problem: bors.toml: not found