cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
95
Views
0
Helpful
0
Replies
Beginner

Etag value returned from NSO rest call may not be within a double quote?

Hi Experts,

 

We are making a rest call to NSO, as part of the reply, NSO will return a response similar to the below with a Etag value:

 

HTTP/1.1 100 Continue
Server:
Allow: GET, POST, OPTIONS, HEAD
Content-Length: 0

HTTP/1.1 201 Created
Server:
Location: http://localhost:8080/api/config/devices/device/pe1
Date: Thu, 11 Apr 2019 16:20:55 GMT
Allow: GET, POST, OPTIONS, HEAD
Last-Modified: Thu, 11 Apr 2019 16:20:56 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Etag: 1554-999656-88572
Content-Length: 0
Content-Type: text/html
Pragma: no-cache

 

Based on debug log on the system making the rest call, it seems to have difficulties interpreting the Etag value.

 

2019-04-09T17:50:12,408 | ERROR | qtp207378844-129 | ExecuteNodeExecutor | 222 - org.onap.ccsdk.sli.core.sli-provider - 0.3.3 | SvcLogicGraph [module=rest-tail-f, rpc=add_new_device, mode=sync, version=1.0.0, md5sum=a066d5196b09b6683fcda45309a8d886] - 8 (execute) | Could not execute plugin. SvcLogic status will be set to failure.
java.lang.IllegalArgumentException: Error parsing entity tag '1554-999656-88572'

 

Upon further checking on the standard, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag

 

Etag value might need to be returned within a double-quote, is it feasible to check if the Etag value returned from NSO is within a double quote ... thanks in advance.

Syntax

ETag: W/"<etag_value>"
ETag: "<etag_value>"

 

Directives

W/ Optional 'W/' (case-sensitive) indicates that a weak validator is used. Weak validators are easy to generate but are far less useful for comparisons. Strong validators are ideal for comparisons but can be very difficult to generate efficiently. Weak Etag values of two representations of the same resources might be semantically equivalent, but not byte-for-byte identical. "<etag_value>" Entity tags uniquely representing the requested resources. They are a string of ASCII characters placed between double quotes (Like "675af34563dc-tr34"). The method by which ETag values are generated is not specified. Oftentimes, a hash of the content, a hash of the last modification timestamp, or just a revision number is used. For example, MDN uses a hash of hexadecimal digits of the wiki content.

Examples

ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"
ETag: W/"0815"

 

Thanks, Tim

Everyone's tags (1)
Content for Community-Ad
August's Community Spotlight Awards
This widget could not be displayed.