File tree Expand file tree Collapse file tree
packages/app/server/api/repo Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,20 +28,6 @@ interface CommitMeta {
2828 branch : string | null ;
2929}
3030
31- function getCommitPanelOrigin ( event : H3Event ) {
32- const requestUrl = getRequestURL ( event ) ;
33- const headers = getHeaders ( event ) ;
34- const host =
35- headers [ "x-forwarded-host" ] ?. split ( "," ) [ 0 ] ?. trim ( ) ||
36- headers . host ?. split ( "," ) [ 0 ] ?. trim ( ) ||
37- requestUrl . host ;
38- const protocol =
39- headers [ "x-forwarded-proto" ] ?. split ( "," ) [ 0 ] ?. trim ( ) ||
40- requestUrl . protocol . replace ( ":" , "" ) ;
41-
42- return `${ protocol } ://${ host } ` ;
43- }
44-
4531async function getCommitMetadata (
4632 installation : Awaited < ReturnType < typeof useOctokitInstallation > > ,
4733 owner : string ,
@@ -251,7 +237,9 @@ export default defineEventHandler(async (event) => {
251237 const nextCursor = hasNextPage ? String ( page + 1 ) : null ;
252238 const totalCount = releases . length ;
253239 const totalPages = Math . max ( 1 , Math . ceil ( totalCount / perPage ) ) ;
254- const origin = getCommitPanelOrigin ( event ) ;
240+ const origin = import . meta. dev
241+ ? getRequestURL ( event ) . origin
242+ : "https://pkg.pr.new" ;
255243 const commitMetadata = await getCommitMetadata (
256244 installation ,
257245 query . owner ,
You can’t perform that action at this time.
0 commit comments