Skip to content

Commit 3bce6d7

Browse files
committed
define API::DEFAULT_LIFF_ENDPOINT
1 parent ed90b2d commit 3bce6d7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/line/bot/api.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Bot
1919
module API
2020
DEFAULT_ENDPOINT = "https://api.line.me/v2"
2121
DEFAULT_BLOB_ENDPOINT = "https://api-data.line.me/v2"
22+
DEFAULT_LIFF_ENDPOINT = "https://api.line.me/liff/v1"
2223

2324
DEFAULT_HEADERS = {
2425
'Content-Type' => 'application/json; charset=UTF-8',

lib/line/bot/client.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def blob_endpoint
6767
end
6868

6969
def liff_endpoint
70-
@liff_endpoint ||= endpoint.sub(%r{/v2\z}, '')
70+
@liff_endpoint ||= API::DEFAULT_LIFF_ENDPOINT
7171
end
7272

7373
# @return [Hash]
@@ -648,28 +648,28 @@ def get_bot_info
648648
def get_liff_apps
649649
channel_token_required
650650

651-
endpoint_path = '/liff/v1/apps'
651+
endpoint_path = '/apps'
652652
get(liff_endpoint, endpoint_path, credentials)
653653
end
654654

655655
def create_liff_app(app)
656656
channel_token_required
657657

658-
endpoint_path = '/liff/v1/apps'
658+
endpoint_path = '/apps'
659659
post(liff_endpoint, endpoint_path, app.to_json, credentials)
660660
end
661661

662662
def update_liff_app(liff_id, app)
663663
channel_token_required
664664

665-
endpoint_path = "/liff/v1/apps/#{liff_id}"
665+
endpoint_path = "/apps/#{liff_id}"
666666
put(liff_endpoint, endpoint_path, app.to_json, credentials)
667667
end
668668

669669
def delete_liff_app(liff_id)
670670
channel_token_required
671671

672-
endpoint_path = "/liff/v1/apps/#{liff_id}"
672+
endpoint_path = "/apps/#{liff_id}"
673673
delete(liff_endpoint, endpoint_path, credentials)
674674
end
675675

0 commit comments

Comments
 (0)