@@ -98,15 +98,6 @@ public void StripUnknownCommands(CommandCollection commands)
9898 public string ? ComputeHMAC ( string uri , CommandHandling handling )
9999 => this . ComputeHMAC ( new Uri ( uri , UriKind . RelativeOrAbsolute ) , handling ) ;
100100
101- /// <summary>
102- /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
103- /// </summary>
104- /// <param name="uri">The uri to compute the code from.</param>
105- /// <param name="handling">The command collection handling.</param>
106- /// <returns>The computed HMAC.</returns>
107- public Task < string ? > ComputeHMACAsync ( string uri , CommandHandling handling )
108- => this . ComputeHMACAsync ( new Uri ( uri , UriKind . RelativeOrAbsolute ) , handling ) ;
109-
110101 /// <summary>
111102 /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
112103 /// </summary>
@@ -124,23 +115,6 @@ public void StripUnknownCommands(CommandCollection commands)
124115 return this . ComputeHMAC ( host , path , queryString , handling ) ;
125116 }
126117
127- /// <summary>
128- /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
129- /// </summary>
130- /// <param name="uri">The uri to compute the code from.</param>
131- /// <param name="handling">The command collection handling.</param>
132- /// <returns>The computed HMAC.</returns>
133- public Task < string ? > ComputeHMACAsync ( Uri uri , CommandHandling handling )
134- {
135- ToComponents (
136- uri ,
137- out HostString host ,
138- out PathString path ,
139- out QueryString queryString ) ;
140-
141- return this . ComputeHMACAsync ( host , path , queryString , handling ) ;
142- }
143-
144118 /// <summary>
145119 /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
146120 /// </summary>
@@ -152,17 +126,6 @@ public void StripUnknownCommands(CommandCollection commands)
152126 public string ? ComputeHMAC ( HostString host , PathString path , QueryString queryString , CommandHandling handling )
153127 => this . ComputeHMAC ( host , path , queryString , new ( QueryHelpers . ParseQuery ( queryString . Value ) ) , handling ) ;
154128
155- /// <summary>
156- /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
157- /// </summary>
158- /// <param name="host">The host header.</param>
159- /// <param name="path">The path or pathbase.</param>
160- /// <param name="queryString">The querystring.</param>
161- /// <param name="handling">The command collection handling.</param>
162- /// <returns>The computed HMAC.</returns>
163- public Task < string ? > ComputeHMACAsync ( HostString host , PathString path , QueryString queryString , CommandHandling handling )
164- => this . ComputeHMACAsync ( host , path , queryString , new ( QueryHelpers . ParseQuery ( queryString . Value ) ) , handling ) ;
165-
166129 /// <summary>
167130 /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
168131 /// </summary>
@@ -175,34 +138,13 @@ public void StripUnknownCommands(CommandCollection commands)
175138 public string ? ComputeHMAC ( HostString host , PathString path , QueryString queryString , QueryCollection query , CommandHandling handling )
176139 => this . ComputeHMAC ( this . ToHttpContext ( host , path , queryString , query ) , handling ) ;
177140
178- /// <summary>
179- /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
180- /// </summary>
181- /// <param name="host">The host header.</param>
182- /// <param name="path">The path or pathbase.</param>
183- /// <param name="queryString">The querystring.</param>
184- /// <param name="query">The query collection.</param>
185- /// <param name="handling">The command collection handling.</param>
186- /// <returns>The computed HMAC.</returns>
187- public Task < string ? > ComputeHMACAsync ( HostString host , PathString path , QueryString queryString , QueryCollection query , CommandHandling handling )
188- => this . ComputeHMACAsync ( this . ToHttpContext ( host , path , queryString , query ) , handling ) ;
189-
190141 /// <summary>
191142 /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
192143 /// </summary>
193144 /// <param name="context">The request HTTP context.</param>
194145 /// <param name="handling">The command collection handling.</param>
195146 /// <returns>The computed HMAC.</returns>
196147 public string ? ComputeHMAC ( HttpContext context , CommandHandling handling )
197- => AsyncHelper . RunSync ( ( ) => this . ComputeHMACAsync ( context , handling ) ) ;
198-
199- /// <summary>
200- /// Compute a Hash-based Message Authentication Code (HMAC) for request authentication.
201- /// </summary>
202- /// <param name="context">The request HTTP context.</param>
203- /// <param name="handling">The command collection handling.</param>
204- /// <returns>The computed HMAC.</returns>
205- public async Task < string ? > ComputeHMACAsync ( HttpContext context , CommandHandling handling )
206148 {
207149 byte [ ] secret = this . options . HMACSecretKey ;
208150 if ( secret is null || secret . Length == 0 )
@@ -222,7 +164,7 @@ public void StripUnknownCommands(CommandCollection commands)
222164 }
223165
224166 ImageCommandContext imageCommandContext = new ( context , commands , this . commandParser , this . parserCulture ) ;
225- return await this . options . OnComputeHMACAsync ( imageCommandContext , secret ) ;
167+ return this . options . OnComputeHMAC ( imageCommandContext , secret ) ;
226168 }
227169
228170 /// <summary>
@@ -234,14 +176,14 @@ public void StripUnknownCommands(CommandCollection commands)
234176 /// </remarks>
235177 /// <param name="context">Contains information about the current image request and parsed commands.</param>
236178 /// <returns>The computed HMAC.</returns>
237- internal async Task < string ? > ComputeHMACAsync ( ImageCommandContext context )
179+ internal string ? ComputeHMAC ( ImageCommandContext context )
238180 {
239181 if ( context . Commands . Count == 0 )
240182 {
241183 return null ;
242184 }
243185
244- return await this . options . OnComputeHMACAsync ( context , this . options . HMACSecretKey ) ;
186+ return this . options . OnComputeHMAC ( context , this . options . HMACSecretKey ) ;
245187 }
246188
247189 private static void ToComponents (
0 commit comments