klortho: Much Accomplished, Much Remaining

Okay, the latest: I’ve fixed the incomplete headers problem, and found a solution to proxying non-XML resources: not to do it at all!

Here’s the way klortho now behaves. It parses the request URL, does a HEAD request on it with the original HTTP headers from the user’s browser, and then takes 1 of 3 actions. If the returned status code is anything other than “200 OK”, it returns the headers it receives. If it gets a “200 OK”, but the “Content-Type” is anything other than “application/xml” or “text/xml”, it sends a “301 Moved Permanently” status, with a “Location” header pointing the user’s browser to the URL parsed from the “PATH_INFO”. This tells the user’s browser that klortho is not interested in brokering this request, and to kindly just get the resource directly from now on, thankyouverymuch. Only if it has a “200 OK”, and the right XML content type does it go ahead and retrieve the body of the response, and process and return it.

Still unfinished:

  1. POST requests. This is a biggie. If the checks succeed, klortho will have to pass in the POSTed data it receives. libCurl has a good tutorial on this. It’s should be straightforward.
  2. Some response headers may need to be adjusted on the way out, the ones that relate to proxying.
  3. Authentication will need to be transparently passed through

Keep checking back, I’ll keep you updated. If you feel like contributing, let me know.

The Links:

  • Share/Bookmark
Post a Comment

You must be logged in to post a comment.