-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does ncdump work for this URL in older versions of the netcdf-c, but not for 4.7.x #1832
Comments
This has to do with url encoding. If you use this URL, it should work (if quoted):
|
I think that I understand. It would seem that having the URL encoded should always be ok. This one without URL encoding does not work
but maybe it's server side. I don't what URL is actually being sent to the server.. |
It appears that this most recent problem has to do with handling of |
Thanks! I admit to being a little confused with who is doing the URL encoding and who should be doing it. I tend to use the URL encoded strings since Ingrid provides them in the webpage (e.g.,http://iridl.ldeo.columbia.edu/SOURCES/.Indices/.soi/.c8110/.anomaly/T/%28Jan%201979%29/VALUE/T/%28days%20since%201960-01-01%29streamgridunitconvert/dods) and they work (usually) across applications. If you identify an issue with the Ingrid server (iridl), I can contact the developers. |
I think in general, the client should encode portions of the URL that it programatically constructs by default (say, when preparing to make a REST API call) and the server should decode before passing information related to the request to the server-side application. However, the backend Ingrid service does not appear to be able to handle enocoded URLs properly (specifically the query portion). Unidata/thredds#1144 (comment) I can't find much information about Ingrid, but my guess is that they've implemented their own web server and it does not fully handle the rules in RFC3986...and that guess is based on language in this entry on the "software that uses netCDF page:
The headers indicate they have a Squid caching proxy setup, so decoding issues might lie above the Ingrid service (note: it's a dangerously old version of Squid, and I cannot find much information about how it handles encoded URLs). The best approach I've found with the
but as pointed out in the github issue I linked to above, there is a chance the request will fail if you encode the query portion of the URL. I've had mixed results on the ability of this server to handle percent encoding in the query, however (sometimes it works, sometimes it does not). My default when interacting with this particular site is to leave the query unencoded. @DennisHeimbigner - is there a way to tell netCDF-C to not handle URL encoding? Perhaps an option in the .dodsrc file, or even better, a runtime option? |
Currently there is no way to tell the DAP2 client library code to not encode something. |
I have attached a zip file containing a new version of libdispatch/ncuri.c. |
Thanks! I don't know exactly how to do that but I will try compiling it later. I got here from an error in xarray, and I'm a little over my head. |
If you installed netcdf using a package manager (apt, yum, conda, etc) then |
re: Github issue Unidata#1832 and Github issue Unidata/netcdf4-python#1041 Handling of URL escape sequences for some servers (e.g. http://iridl.ldeo.columbia.edu) appears to be somewhat non-standard. In particular, certain characters need escaping that other servers do not. Fortunately, the changes should also work existing other servers.
Fixed in #1835 |
This is a follow on to Unidata/netcdf4-python#1041
For 4.7.x,
ncdump -h http://iridl.ldeo.columbia.edu/SOURCES/.Indices/.soi/.c8110/.anomaly/T/%28Jan%201979%29/VALUE/dods
failsSee Unidata/netcdf4-python#1041 (comment)
For older versions, there is no problem.
The text was updated successfully, but these errors were encountered: