• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating working wocontext()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating working wocontext()


  • Subject: Re: Creating working wocontext()
  • From: Klaus Berkling <email@hidden>
  • Date: Wed, 19 Apr 2017 07:41:45 -0700


On Apr 18, 2017, at 4:43 AM, Johann Werner <email@hidden> wrote:

Hi Klaus,

I would use a relative URL but set some header values to mimic a request coming from a webserver proxy. Try something like this:


String host = "apps.berkeling.us";
String isSecure = true;

ERXApplication app = ERXApplication.erxApplication();
NSMutableDictionary<String, String> headers = new NSMutableDictionary<>();
if (!app.isDevelopmentMode()) {
   headers.put("x-webobjects-adaptor-version", "Apache");
   headers.put("host", host);
   headers.put("x-webobjects-server-port", isSecure ? "443" : "80");
}
ERXRequest fakeRequest = new ERXRequest("GET", app.adaptorPath() + "/" + app.name() + ".woa", "HTTP/1.1“, headers, null, null);
WOContext context = new ERXWOContext(fakeRequest);


Does that work for you?


This is indeed the direction I’m heading into, creating the context from a fake request.

Thanks.


Klaus Berkling
www.berkling.us | Photography




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Creating working wocontext() (From: Klaus Berkling <email@hidden>)

  • Prev by Date: Re: Creating working wocontext()
  • Next by Date: Re: Creating working wocontext()
  • Previous by thread: Re: Creating working wocontext()
  • Index(es):
    • Date
    • Thread