Skip to content

Commit

Permalink
style: remove unused definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Mar 14, 2022
1 parent ebf8a64 commit dc6f851
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
2 changes: 0 additions & 2 deletions example/dart_wot_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//
// SPDX-License-Identifier: BSD-3-Clause

import 'dart:io';

import 'package:dart_wot/dart_wot.dart';

final thingDescriptionJson = '''
Expand Down
8 changes: 2 additions & 6 deletions lib/src/binding_http/http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import '../definitions/security/bearer_security_scheme.dart';
import '../definitions/security/credentials_scheme.dart';
import '../definitions/security/digest_security_scheme.dart';
import '../scripting_api/subscription.dart';
import 'http_config.dart';

const _authorizationHeader = "Authorization";

Expand Down Expand Up @@ -76,11 +75,8 @@ typedef _OtherHttpMethod = Future<Response> Function(Uri uri,
/// [RFC 6750]: https://datatracker.ietf.org/doc/html/rfc6750
/// [`ComboSecurityScheme`]: https://w3c.github.io/wot-thing-description/#combosecurityscheme
class HttpClient extends ProtocolClient {
/// An (optional) custom [HttpConfig] which overrides the default values.
final HttpConfig? _httpConfig;

/// Creates a new [HttpClient] based on an optional [HttpConfig].
HttpClient([this._httpConfig]);
/// Creates a new [HttpClient].
HttpClient();

Future<Response> _createRequest(
Form form, OperationType operationType, Object? payload) async {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_http/http_client_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HttpClientFactory extends ProtocolClientFactory {
}

@override
ProtocolClient createClient() => HttpClient(httpConfig);
ProtocolClient createClient() => HttpClient();

@override
bool init() {
Expand Down
10 changes: 2 additions & 8 deletions lib/src/binding_http/http_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ class HttpServer extends ProtocolServer {

final int _port;

final HttpConfig? _httpConfig;

Map<String, Map<String, Credentials>> _credentials = {};

/// Create a new [HttpServer] from an optional [HttpConfig].
HttpServer(this._httpConfig)
HttpServer(HttpConfig? _httpConfig)
// TODO(JKRhb): Check if the scheme should be determined differently.
: _scheme = _httpConfig?.secure ?? false ? "https" : "http",
_port = _portFromConfig(_httpConfig);
Expand All @@ -45,9 +41,7 @@ class HttpServer extends ProtocolServer {
String get scheme => _scheme;

@override
Future<void> start(Map<String, Map<String, Credentials>> credentials) async {
_credentials = credentials;
}
Future<void> start(Map<String, Map<String, Credentials>> credentials) async {}

@override
Future<void> stop() async {
Expand Down

0 comments on commit dc6f851

Please sign in to comment.