Open nicholascar opened 3 years ago
I see the point. We will phase it into our stack as soon as possible, but: Are the EPSG resolver and the Australian tool doing the same thing? We might want to stay in sync.
@pebau The server at Jacobs University is indeed returning a content-type header.
However, the media type for GML is application/gml+xml
but the server is returning text/xml;charset=utf-8
. Please see the IANA registration at https://www.iana.org/assignments/media-types/application/gml+xml
@RogerLott The IOGP server is not returning any content-type headers. Please see the screenshot below.
ok, will have a look.
@pebau @ghobona @nicholascar
If you wanted to set setContentType to application/gml+xml then when you access CRS URL on a web browser, it will download the content in a file and you have to open it to view the content, instead of displaying it like https://crs.rasdaman.com/def/crs/OGC/0/CRS84. Is that what you really wanted?
@bangph I think what we really need is to apply content negotiation. Specifically the Accept
header as specified in RFC 7231.
Would it be possible to set the content type using the following logic, described below in pseudocode?
if (request.getHeader("Accept").equals("application/gml+xml")) then{
response.setContentType("application/gml+xml");
}
else {
response.setContentType("text/xml;charset=utf-8");
}
@ghobona yes it is possible for the way which you suggested. Default it returns text/xml
and if a client requests with request header application/gml+xml
then it returns application/gml+xml
for it.
@bangph Thanks for confirming that it is possible. Please proceed with the modification.
@ghobona I updated SECORE on our server. Now it works like you suggested (you could close the issue after checking)
default request:
curl -I 'https://crs.rasdaman.com/def/crs/OGC/0/CRS84'
HTTP/1.1 200
Date: Wed, 04 Oct 2023 09:06:42 GMT
Server: Apache/2.4.41 (Ubuntu)
Vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers
Content-Type: text/xml;charset=utf-8
and with request header:
curl -H 'Accept: application/gml+xml' -I 'https://crs.rasdaman.com/def/crs/OGC/0/CRS84'
HTTP/1.1 200
Date: Wed, 04 Oct 2023 09:06:57 GMT
Server: Apache/2.4.41 (Ubuntu)
Vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers
Content-Type: application/gml+xml
Thanks @bangph . I have verified the modification. No further action is required on the Jacobs University server.
application/gml+xml
media type example below:
default media type example below:
I will close the GitHub Issue after discussing with the maintainers of the IOGP server.
e.g. http://www.opengis.net/def/crs/EPSG/0/4326 (WGS 84) returns XML but provides no Media Type in the
Content-Type
header to let the client know this. Full response headers are: