Skip to content

Commit 5f8cff1

Browse files
committed
configuring linkcheck to handle 403 client error
1 parent 962f54f commit 5f8cff1

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

doc/conf.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,21 @@
183183

184184
linkcheck_retries = 3 # default is 1
185185

186+
# About User-Agent:
187+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
188+
linkcheck_request_headers = {
189+
"*": { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0' },
190+
}
191+
186192
linkcheck_ignore = [
187193
# currently SSL_ERROR_BAD_CERT_DOMAIN
188194
# TODO remove this line when the CERT is fixed
189195
r'https://www.rspatial.org',
190196

197+
198+
# NewConnectionError looks like information is wrong
199+
r'http://udig.refractions.net',
200+
191201
# link exists but does not accept robots and linkchecker is a robot
192202
# used in overview/mapserver_overview
193203
'http://www.dnr.state.mn.us/maps/compass.html',
@@ -200,10 +210,6 @@
200210
'https://www.iso.org',
201211
r'https://inspire.ec.europa.eu',
202212

203-
# 403 Client Error: Forbidden for url
204-
r'https://www.intel.com/',
205-
r'https://www.mydigitallife.net/',
206-
207213
# HTTPSConnectionPool
208214
r'https://worldwind.arc.nasa.gov/java/',
209215
r'https://r-spatial.org',
@@ -218,14 +224,15 @@
218224
r'https://live.osgeo.org/archive/15.0',
219225
r'https://live.osgeo.org/archive/16.0',
220226

227+
# For the following an appropiate user agent is needed
221228
# 403 Client Error
229+
r'https://www.intel.com',
230+
r'https://www.mydigitallife.net',
222231
r'https://docs.etf-validator.net',
223232
r'https://etf-validator.net',
224233
r'https://www.ogc.org',
225-
r'https://external.ogc.org',
226-
r'https://www.safe.com',
227-
r'https://www.geowebcache.org',
228-
r'https://www.geoext.org',
234+
r'https://sourceforge.net',
235+
r'https://opensource.org',
229236

230237
# link exists but when many link checks are done link checker fails
231238
# ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

0 commit comments

Comments
 (0)