Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
本番だけWebViewが500エラーになる
Search
Hayate Kuronuma
September 29, 2026
Programming
57
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
本番だけWebViewが500エラーになる
Hayate Kuronuma
September 29, 2026
Transcript
12 slides
#25 Mobile勉強会 ウォンテッドリー × チームラボ 本番だけWebViewが500になる Sep.29 2026 - Hayate
Kuronuma © 2026 Wantedly, Inc.
⾃⼰紹介 名前:黒沼 疾風 / Hayate Kuronuma 入社:2025年9月 ポジション: iOSエンジニア 性格診断:コントリビューター
MBTI:ISFP (冒険家) © 2026 Wantedly, Inc.
A⾯B⾯ジェネレーター © 2026 Wantedly, Inc.
起きたこと 本番だけ 500 になる アプリ内 WebView で開くページが、本番でだけエラーページになる。検証環境では再現しない。 © 2026 Wantedly,
Inc.
起きた範囲 Android の本番だけ 500 になる 検証環境 本番 Android 正常 500
iOS 正常 正常 © 2026 Wantedly, Inc.
Androidで起きていたこと Authorization がリダイレクトを越えていた WebView トークン→Cookie ⽬的のページ エンドポイント SSR 上流 API
① loadUrl + Bearer ② 302 + Set-Cookie shouldOverrideUrlLoading 何もせず進める ③ Cookie + Bearer(そのまま持ち越し) ④ Bearer を素通し ⑤ 検証に失敗 ⑥ 500 © 2026 Wantedly, Inc.
検証環境では問題なかったわけ 検証環境は、たまたま助かっていた WebView トークン→Cookie ⽬的のページ エンドポイント SSR 上流 API ①
loadUrl + Bearer ② 302 + Set-Cookie shouldOverrideUrlLoading 検証環境⽤ヘッダに付け替え ③ loadUrl + Basic(Cookie あり、Bearer は消えた) ④ Basic を素通し ⑤ Basic は無視して成功 ⑥ 200 © 2026 Wantedly, Inc.
原因 - Chromiumを⾒てみる 同じドメインの中なら、ヘッダは外されない Android WebView がリダイレクトのたびに呼ぶ処理 ─ aw_url_loader_throttle.cc(抜粋) void
AwURLLoaderThrottle::WillRedirectRequest(...) { bool is_same_domain = net::registry_controlled_domains::SameDomainOrHost( redirect_info->new_url, original_origin_, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); if (!is_same_domain) { // The headers we added must be removed. headers_update_params->removed_headers.insert(...); } } 同じドメインの中のリダイレクト → 付けたヘッダを残す © 2026 Wantedly, Inc. 別のドメインへ出るリダイレクト → 付けたヘッダを外す
iOS との違い iOS では起きなかった Android iOS loadUrl(url, headers) load(URLRequest) 同じドメインの中なら、リダイレクトの先にも
ホストが変わる リダイレクトで Authorization 付く。 を落とす。 © 2026 Wantedly, Inc.
直し⽅ 本番でも、ヘッダなしで開き直す WebView トークン→Cookie ⽬的のページ エンドポイント SSR 上流 API ①
loadUrl + Bearer ② 302 + Set-Cookie shouldOverrideUrlLoading ⽌めて読み直す(本番でも) ③ loadUrl(Cookie あり、Bearer は外した) ④ Cookie で問い合わせ ⑤ 成功 ⑥ 200 © 2026 Wantedly, Inc.
まとめ 01 02 03 リダイレクト先にも届く 外すなら、読み直す 環境差分を認識する 同じドメインの中なら、 リダイレクトを⽌めて、必 環境独⾃の設定があり、完
loadUrl のヘッダは外され 要なヘッダだけで loadUrl 全に本番の保証にならない ない。 し直す。 ことがある。 © 2026 Wantedly, Inc.
ご清聴ありがとうございました! © 2026 Wantedly, Inc.
More Decks by Hayate Kuronuma
See All by Hayate Kuronuma
ユーザー価値を届け続けるために、ウォンテッドリーが大切にしている文化
hayatekuronuma
0
10
UIKitにSwiftUIを埋め込んだら 罠にハマった話
hayatekuronuma
0
17
Other Decks in Programming
See All in Programming
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.3k
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
270
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.3k
SODA - FACT BOOK(JP)
sodainc
1
40k
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
290
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
140
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
150
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
330
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
210
あなたはMCPの機能を、まだ知らない。
4geru
1
500
Spec-driven Development with AI
simas
PRO
0
2.3k
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.8k
New Earth Scene 8
popppiees
5
2.8k
Navigating Weather and Climate Data
rabernat
0
590
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
How to build a perfect <img>
jonoalderson
1
6.2k
Exploring anti-patterns in Rails
aemeredith
4
570
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
590
WENDY [Excerpt]
tessaabrams
15
41k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
The Language of Interfaces
destraynor
162
27k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520