LucGosso / Gosso.EPiServerAddOn.DownloadIfMissingFileBlob

This EPiServer AddOn provider copies (when page loads) the file blobs from production to your local environment, or to your staging/test environment
4 stars 2 forks source link

Include cookies in requests #5

Closed barlind closed 6 years ago

barlind commented 6 years ago

Hey! Lovin' the provider!

However, in our current project the prod server (or rather our integrated dev environment) requires a certain cookie value for the request to be allowed; thus the normal implementation failed.

In this PR I added an extra config property called Cookies that can supply the httpClient with cookies to include.

I also moved the httpClient to a shared field, which should be a bit better performance wise as well.

LucGosso commented 6 years ago

Hi Tobias, great, thanx for contributing, i will accept it and publish it to nuget.

Is this some kind of security measurments? you'll have to show me how that is set up ;)

barlind commented 6 years ago

It's just a precaution for prying eyes, basically it's an IHttpModule that on context_BeginRequest checks if the request contains a certain cookie with a certain value. If it does not then we just output a textbox where the user has to enter the code, which is then set to the cookie upon submit.

Pretty simple but it works rather well :)

barlind commented 6 years ago

Just noticed a stupid mistake; I added the information about the cookies to the readme in /Projects and not the main one - so it's not visible there.

LucGosso commented 6 years ago

Now it is on the Epi Nuget feed too!