Welcome Guest Search | Active Topics | Sign In | Register

Request Referer Header Not Working Options
Zius
Posted: Saturday, July 14, 2018 2:49:32 AM
Rank: Newbie
Groups: Member

Joined: 7/14/2018
Posts: 7
Im trying to set a referer header on a request, im using webview's BeforeRequestLoaded event while using LoadUrl and LoadRequest Method/s
using this code variants:

NOTE: im using webBrowser v 16.2.96

Code: C#
e.Request.Headers["Referer"] = "http://example.com";

or
Code: C#
e.Request.Headers.Add("Referer","http://example.com");

i don't get any compiler error but when i use a http monitor tools like charles or Fiddler i see that the header is not being set.

i even tried to set the header on the request before using it like so:

Code: C#
Request req= new Request("http://mytargeturl.com");
  req.Headers.Add("Referer","http://example.com");
  //or 
  req.Headers["Referer"] = "http://example.com";
  //then call the loadrequest method
  WebView1.LoadRequest(req);


still not getting it to work. when i try to set a test header like so:

Code: C#
req.Headers["test"] = "http://example.com";
  //then call the loadrequest method
  WebView1.LoadRequest(req);


i see it working. so i wonder if this feature only available in the licensed version only or im doing something wrong?



eo_support
Posted: Saturday, July 14, 2018 2:58:52 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
Hi,

Please try the latest build and see if it resolves the issue for you. I believe this was an issue that was fixed in 2017.2.0.

Thanks!
Zius
Posted: Monday, July 16, 2018 1:53:00 AM
Rank: Newbie
Groups: Member

Joined: 7/14/2018
Posts: 7
eo_support wrote:
Hi,

Please try the latest build and see if it resolves the issue for you. I believe this was an issue that was fixed in 2017.2.0.

Thanks!

upgrading to version 17.2.0 solved the problem for me thanks, i have got another problem so im not sure if i must make a new thread or mention it just here; so i will mention it here and if its better to make a new thread let me know.

First an overview of my application workflow:

1 - the application creates a new custombrowser object which is a class that implements Webview object
2 - the custombrowser object has a webview which gets set to load a certain page for a giving period of time, it also has all the methods needed and listen to the events i need to listen to.
3 - when the time is up the webview is stopped then closed then destroyed and finally disposed and set to null.
4 - a call to the Garbage Collector is made.

Code: C#
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();

these steps keep happening for each page. and the application runs for days
i notice that after a day or more one of the child process of the webbroswer Windows Host Child Process(RUNDLL 32) gets stuck in memory and raises the cpu usage up to 100% and caused the system to crash, im logging errors using a try catch statement. also before invoking the webview instance i make sure its not null. i have made few attempts to try and fix this issue one of them was using eowpe.exe but it didn't help.
i think the problem has something to do with the dispose method on the webview.
here is the error i get:
Object reference not set to an instance of an object.
at EO.WebBrowser.WebView.al(cn A_0, ase A_1)
at EO.WebBrowser.WebView.a(cn A_0, ase A_1)
at EO.WebBrowser.WebView.b(cn A_0, ase A_1)
NOTE: this still while using version 16.2.96, i use this version because i need XP support and newer version dose not support xp

any ideas how to avoid this problem? or figure out why it happens in first place?

Thanks.
eo_support
Posted: Monday, July 16, 2018 9:16:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
Hi,

We have officially stopped supporting XP for quite a while, besides a lot of issues have already been fixed in more recent builds and new fixes are only being applied to the current build. So going forward you definitely want to update to newer versions.

If it is not possible for you to update to the current version, one thing you can try to do is to restart the browser engine periodically and see if it helps. This can be useful when the problem originates from the browser engine. See here for more details about browser engine:

https://www.essentialobjects.com/doc/webbrowser/advanced/engine.aspx

If that still does not work, you may want to consider restarting AppDomain or your application in order to address the issue. We won't be able to investigate this issue since this is an older version on an unsupported platform. If you update to the current build and still experience this problem, you can try to isolate the problem into a test project and send the test project to us. See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have that we will be happy to investigate further.

Thanks!
Zius
Posted: Monday, July 16, 2018 5:01:58 PM
Rank: Newbie
Groups: Member

Joined: 7/14/2018
Posts: 7
thanks for the quick reply. much appreciated.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.