Skip to content

Commit 292484f

Browse files
authored
fix license script (#36328)
* fix license script * fix license script * fix license script
1 parent 970f6b2 commit 292484f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdks/java/container/license_scripts/pull_licenses_java.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def pull_from_url(file_name, url, dep, no_list, use_cache=False):
142142
def pull_source_code(base_url, dir_name, dep):
143143
# base_url example: https://repo1.maven.org/maven2/org/mortbay/jetty/jsp-2.1/6.1.14/
144144
try:
145-
soup = BeautifulSoup(urlopen(base_url).read(), "html.parser")
145+
soup = BeautifulSoup(urlopen(Request(base_url, headers={
146+
'User-Agent': 'Apache Beam'})).read(), "html.parser")
146147
except:
147148
logging.error('Error reading source base from {base_url}'.format(base_url=base_url))
148149
raise

0 commit comments

Comments
 (0)