| Summary: | [sites] Some APIs giving errors on self hosted site | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | Client | Assignee: | Mark Macdonald <mamacdon> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 0.3 | ||
| Target Milestone: | 0.3 RC2 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Mark Macdonald
The access-control error is due to several places that return Task resources with an unexpected URL format:
> {
> "Id": "AGcjkRL0ABAQAeLMpxFpfQ",
> "Location": "http://localhost:8080/task/id/AGcjkRL0ABAQAeLMpxFpfQ",
> ... }
The URL should be /task/id/AGcjkRL0ABAQAeLMpxFpfQ otherwise the inner site can't deal with it.
(In reply to comment #1) I fixed some of this, but there is another problem with the URL-rewriting magic done by the server and the Task API. Just before writing the response body, the server strips off host, port, scheme from URLs to produce relative URLs required for the inner site's XHR calls to work. The code that does this expects a JSON object containing typed URI objects (sigh). Anything passing through the TaskService gets serialized to JSON and reparsed. When writing a Task result, the URI types are already gone, and we don't attempt to rewrite URLs inside plain strings. New problem: /images/none.png is 404ing, which produces a funny border around sprited icons. (In reply to comment #2) URLs are now parsed out of string values encountered in OrionServlet.writeJSONResponse(), and made relative if possible. I had to exclude the Site Configuration servlet from this, as otherwise the server would rewrite the contents of a self-hosting configuration and wreck it when you're running on localhost (eg. "http://localhost:8080/file" would become "/file" which gets interpreted as a project reference). This should fix all the Git features under self hosting. Client: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=354903e1d88a24e336b2d1c45887e51bcd3b4c0e Server: http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=cb5fdef854e8109a041af542ba68f8e6d7ce0016 *** Bug 359609 has been marked as a duplicate of this bug. *** |