-
Notifications
You must be signed in to change notification settings - Fork 12
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
writeDictItems cannot overwrite #27
Comments
The underlying issue is that the dictionary is
HTTP/1.1 200 OK
Status: 200 OK
Content-Type: application/json
Cache-Control: no-cache
Accept-Ranges: bytes
Via: 1.1 varnish
Content-Length: 211
Accept-Ranges: bytes
Date: Tue, 22 Jan 2019 10:10:49 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-control-slwdc9035-CONTROL-SLWDC, cache-hhn1546-HHN
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1548151849.924595,VS0,VE489
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
{"version":26,"name":"strain_deny","deleted_at":null,"service_id":"6E6ge7REhiWetPCqy9jht2","created_at":"2019-01-22T09:46:25Z","write_only":true,"updated_at":"2019-01-22T09:46:25Z","id":"6YKIcQLobbr3ZNJXd6Wr0p"} and then:
HTTP/1.1 400 Bad Request
Status: 400 Bad Request
Content-Type: application/json
Cache-Control: no-cache
Accept-Ranges: bytes
Via: 1.1 varnish
Accept-Ranges: bytes
Content-Length: 86
Accept-Ranges: bytes
Date: Tue, 22 Jan 2019 10:10:50 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-control-slwdc9037-CONTROL-SLWDC, cache-hhn1521-HHN
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1548151850.553670,VS0,VE469
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
{"msg":"Bad request","detail":"Not allowed to read contents of write_only dictionary"} Therefore:
HTTP/1.1 409 Conflict
Status: 409 Conflict
Content-Type: application/json
Cache-Control: no-cache
Fastly-RateLimit-Remaining: 867
Fastly-RateLimit-Reset: 1548154800
Accept-Ranges: bytes
Via: 1.1 varnish
Content-Length: 154
Accept-Ranges: bytes
Date: Tue, 22 Jan 2019 10:10:50 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-control-slwdc9036-CONTROL-SLWDC, cache-hhn1547-HHN
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1548151850.902627,VS0,VE494
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
{"msg":"Duplicate record","detail":"Duplicate dictionary_item: 'dictionary_id=01zrr2NLhDsfCDwg02J3nY item_key=default service_id=6E6ge7REhiWetPCqy9jht2'"} |
Getting the value of an edge dictionary value for a write-only dictionary results in an error 400 from the Fastly API, which is correct, but not helpful. Because `readDictItem` always gets the dictionary metadata before reading, we can guard against this error and return a proper response (status: 403, item_value: undefined) fixes #27
## [1.3.2](v1.3.1...v1.3.2) (2019-01-22) ### Bug Fixes * **fastly:** Return undefined for dict values of write-only edge dicts ([ab5972a](ab5972a)), closes [#27](#27)
🎉 This issue has been resolved in version 1.3.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The text was updated successfully, but these errors were encountered: