Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20 from weka-io/json_type_deprecation
Browse files Browse the repository at this point in the history
Fix deprecated std.json.JSON_TYPE --> std.json.JSONType (fix for dlan…
  • Loading branch information
olehlong authored Sep 3, 2020
2 parents 74efd9e + c8f13a4 commit 69425b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/jwtd/jwt.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ string encode(in ubyte[] payload, string key, JWTAlgorithm algo = JWTAlgorithm.H
import std.functional : memoize;

auto getEncodedHeader(JWTAlgorithm algo, JSONValue fields) {
if(fields.type == JSON_TYPE.NULL)
if(fields.type == JSONType.null_)
fields = (JSONValue[string]).init;
fields.object["alg"] = cast(string)algo;
fields.object["typ"] = "JWT";
Expand All @@ -84,7 +84,7 @@ unittest {

// Code coverage for when header_fields is NULL type
auto header_fields = JSONValue();
assert(header_fields.type == JSON_TYPE.NULL);
assert(header_fields.type == JSONType.null_);
auto payload = JSONValue([ "a" : "b" ]);
encode(payload, public256, JWTAlgorithm.HS256, header_fields);
}
Expand Down

0 comments on commit 69425b7

Please sign in to comment.