File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,27 @@ import {parseLocation} from '../../parse/location.js';
99const baseProfile = require ( './base.json' ) ;
1010import { products } from './products.js' ;
1111
12+ // https://github.com/public-transport/hafas-client/issues/184#issuecomment-2646119337
13+ const PKP_USER_AGENT = 'Dalvik/2.1.0' ;
14+
1215const trimStopName = ( { parsed} , l ) => {
1316 if ( parsed . type === 'stop' || parsed . type === 'station' && parsed . name ) {
1417 parsed . name = parsed . name . replace ( / ( ^ - | - $ ) / g, '' ) ;
1518 }
1619 return parsed ;
1720} ;
1821
22+ const transformReqOverrideUserAgent = ( ctx , req ) => {
23+ req . headers [ 'user-agent' ] = PKP_USER_AGENT
24+ return req
25+ }
26+
1927const profile = {
2028 ...baseProfile ,
2129 locale : 'pl-PL' ,
2230 timezone : 'Europe/Warsaw' ,
31+ randomizeUserAgent : false ,
32+ transformReq : transformReqOverrideUserAgent ,
2333
2434 products,
2535
You can’t perform that action at this time.
0 commit comments