Hillrunner2008 / mydas

Automatically exported from code.google.com/p/mydas
0 stars 0 forks source link

Capabilities header is not always reported #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Any command reporting an error
2. Sources command with status ok

What is the expected output? 
Andy says:
Yes, the capabilities should always be reported, whether an error or not. If 
the source cannot be identified from the request, just report the server 
capabilities (sources/1.0)

What do you see instead?
Capabilities are null so are not reported in the response headers

Additional:
CORS headers Access-Control-Allow-Origin = * and Access-Control-Expose-Headers 
should be also included

Original issue reported on code.google.com by leylaj...@gmail.com on 4 Aug 2010 at 3:23

GoogleCodeExporter commented 9 years ago
Solution: Change the report format of capabilities, report them always, and add 
the CORS headers.

Affected classes
1. DatasourceConfiguration: Capabilities were reported as das1:sources, etc. 
instead sources/1.0 thus the method getCapabilities changed
2. MydasServlet: The writeHeader method now report sources/1.0 when 
capabilities are null (it means when the source cannot be identified from the 
request), it also reports the CORS headers. Errors are reported in a "nice" 
HTMl page instead the regular HTTP Error page. 
3. DasCommandManager: Capabilities are only reported as null when the source 
cannot be identified (dsnCommand and sourcesCommand)

Original comment by leylaj...@gmail.com on 9 Aug 2010 at 9:01

GoogleCodeExporter commented 9 years ago
In relation to point 2 in previous comment:

Since errors are reported by means of a customized page, it is necessary to 
send the HTTP error status, otherwise it will look as "200 OK"

Solution:
MydasServlet: For XDasStatus 400, 401, and 402 the HTTP status will be sent, 
for XDASStatus 404 the HTTP status 404 will be sent, and for XDasStatus 500 and 
501 the HTTP status 500 will be sent.

Status will be sent instead an error response.

Original comment by leylaj...@gmail.com on 9 Aug 2010 at 10:34

GoogleCodeExporter commented 9 years ago

Original comment by leylaj...@gmail.com on 25 Feb 2011 at 12:02