diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py
index 56566ce0..b617b6fa 100755
--- a/utils/ipc/extract-docs.py
+++ b/utils/ipc/extract-docs.py
@@ -12,6 +12,7 @@ import sys
 
 regex_block_start = re.compile('^\/\*\*$')
 regex_block_end = re.compile('^ \*\/$')
+regex_spdx = re.compile('^\/\* SPDX-License-Identifier: .* \*\/$')
 
 
 def main(argv):
@@ -28,8 +29,13 @@ def main(argv):
 
     lines = open(args.input, 'r').readlines()
     pipeline = args.input.split('/')[-1].replace('.mojom', '')
-    data = f'''\
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+    if regex_spdx.match(lines[0]):
+        data = lines[0]
+    else:
+        data = '/* SPDX-License-Identifier: LGPL-2.1-or-later */'
+
+    data += f'''\
 /*
  * Copyright (C) 2021, Google Inc.
  *
