Opened 5 years ago

Closed 5 years ago

#1926 closed defect (fixed)

WCPS doesn't set content-disposition

Reported by: Dimitar Misev Owned by: Bang Pham Huu
Priority: minor Milestone: 9.7
Component: petascope Version: development
Keywords: Cc:
Complexity: Medium

Description

With curl I get this for WCPS (no content-disposition):

curl --verbose 'http://localhost:8080/rasdaman/ows?service=WCS&version=2.0.1&request=ProcessCoverages&query=for c in (test_rgb) return encode(c, "jpeg")' -J -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /rasdaman/ows?service=WCS&version=2.0.1&request=ProcessCoverages&query=for c in (test_rgb) return encode(c, "jpeg") HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.61.0
> Accept: */*
> 
< HTTP/1.1 400 
< Content-Type: text/html;charset=utf-8
< Content-Language: en
< Content-Length: 2187
< Date: Thu, 29 Nov 2018 14:50:30 GMT
< Connection: close
< 
{ [2187 bytes data]
100  2187  100  2187    0     0  2135k      0 --:--:-- --:--:-- --:--:-- 2135k
* Closing connection 0

for WCS it's set properly:

curl --verbose 'http://localhost:8080/rasdaman/ows?service=WCS&version=2.0.1&request=GetCoverage&coverageId=test_mr&subset=i(0,20)&subset=j(0,5)&format=image/jpeg' -J -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /rasdaman/ows?service=WCS&version=2.0.1&request=GetCoverage&coverageId=test_mr&subset=i(0,20)&subset=j(0,5)&format=image/jpeg HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.61.0
> Accept: */*
> 
< HTTP/1.1 200 
< File-name: test_mr.jpeg
< Content-disposition: inline; filename=test_mr.jpeg
< Content-Type: image/jpeg
< Content-Length: 216
< Date: Thu, 29 Nov 2018 14:51:12 GMT
< 
{ [216 bytes data]
100   216  100   216    0     0  10285      0 --:--:-- --:--:-- --:--:-- 10285
* Connection #0 to host localhost left intact
curl: Saved to filename 'test_mr.jpeg'

There's a test which works with wget --content-disposition fine, but doesn't work with curl -J -O.

Change History (2)

comment:1 by Dimitar Misev, 5 years ago

If it's an error this content-disposition should be set to error_covId.xml

comment:2 by Bang Pham Huu, 5 years ago

Resolution: fixed
Status: newclosed

The problem with this request is curl needs to encode spaces inside WCPS query (e.g: this error query). If it is encoded, it will show Content-disposition as WCS request. e.g:

 curl --verbose 'http://localhost:8082/rasdaman/ows?service=WCS&version=2.0.1&request=ProcessCoverages&query=for%20c%20in%20(test_3rgb)%20return%20encode(c%2C%20%22jpeg%22)%27' -J -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to localhost port 8082 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8082 (#0)
> GET /rasdaman/ows?service=WCS&version=2.0.1&request=ProcessCoverages&query=for%20c%20in%20(test_3rgb)%20return%20encode(c%2C%20%22jpeg%22)%27 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8082
> Accept: */*
> 
< HTTP/1.1 500 
< Content-disposition: inline; filename=error.xml
< Content-Type: text/xml
< Content-Length: 599
< Date: Thu, 14 Mar 2019 09:25:11 GMT
< Connection: close

Note: See TracTickets for help on using tickets.