Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
seaeunlee committed Nov 9, 2023
1 parent 2513415 commit 35cc2ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/subscriptions/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = async function (context, req) {
context.log('2 JavaScript HTTP trigger function processed a request for URL ${req.url}".');

const urlRegex = /^(https?:\/\/)?[a-zA-Z0-9.-]+\/arm\/api\/subscriptions\/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\?api-version=2.0$/;
const urlRegex = /^(https?:\/\/)?[a-zA-Z0-9.:\-]+\/arm\/api\/subscriptions\/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\?api-version=2.0$/;
// https://gray-water-0de...net/arm/api/subscriptions/7d589e74-608d-4ec3-8fbf-168c6894a003?api-version=2.0
if (req.method === 'PUT' && urlRegex.test(req.url)) {
const requestBody = req.body;
context.res = {
Expand Down

0 comments on commit 35cc2ca

Please sign in to comment.